0
votes

I am an azure newbie who has a mongodb database on Azure cloud storage. I am trying to delete a row with a specific value from the Query explorer in Azure, but I keep getting this error. Am I missing something? enter image description here

delete from users where _id='...' doesnt work neither does delete * from users where _id='' work

this works perfectly even if am doing SQL on a mongodb database while querying enter image description here

1
If you have a MongoDB database don't you have to use mongo syntax and not SQL? docs.mongodb.com/v3.2/tutorial/remove-documents - Erik
@Erik check my update, the select query works perfectly in sql syntax - PirateApp
tried to write delete in small letters (it's not marked as a keyword in the explorer)? Just guessing at this point, don't know how Azure actually translates the queries. - Erik
i also tried that, no luck - PirateApp

1 Answers

2
votes

I think you are using Microsoft DocumentDB (not mongoDB). DocumentDB is available on Azure and supports SQL-like queries.

I suggest taking a look at the documentation: https://azure.microsoft.com/en-us/documentation/articles/documentdb-sql-query/

According to the docs INSERT, UPDATE, and DELETE are only available through the REST API and not in the query language.