84612

Delete a row from mongodb database in azure

Question:

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? <a href="https://i.stack.imgur.com/b2Qmk.png" rel="nofollow"><img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/b2Qmk.png" data-original="https://i.stack.imgur.com/b2Qmk.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" /></a>

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 <a href="https://i.stack.imgur.com/wGyvj.png" rel="nofollow"><img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/wGyvj.png" data-original="https://i.stack.imgur.com/wGyvj.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" /></a>

Answer1:

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: <a href="https://azure.microsoft.com/en-us/documentation/articles/documentdb-sql-query/" rel="nofollow">https://azure.microsoft.com/en-us/documentation/articles/documentdb-sql-query/</a>

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

Recommend

  • Android CalendarContract, deleting a recurring event causes all events to disappear on calendar?
  • FindAndModify, return array of Objects
  • Mongodb exception, “ MongoCursorException' with message '$ operator made object too large”
  • How to remove left and right margins from all wrapped rows in flexbox (without nth-child or js)
  • Unable to run SDL program in Eclipse but able to do so in Windows Explorer
  • cd command not working with execvp
  • Generic/Unknown HTTP Error with response code 0 using UnityWebRequest
  • Problems with toDataURL HTML5 other ways to get canvas data?
  • Find JSON nested nodes using multiple string values
  • pyodbc doesn't report sql server error
  • Query to find the duplicates between the name and number in table
  • Problem while Building a Setup Project for a windows Service?
  • Eloquent update method change created_at timestamp
  • PHP buffered output depending on server setting?
  • MongoError: Incorrect arguments
  • Why does access(2) check for real and not effective UID?
  • Is it possible to access block's scope in method?
  • Meteor helpers not available in Angular template
  • PHPUnit_Framework_TestCase class is not available. Fix… - Makegood , Eclipse
  • PHP - How to update data to MySQL when click a radio button
  • How to make a tree having multiple type of nodes and each node can have multiple child nodes in java
  • Counter field in MS Access, how to generate?
  • Sony Xperia Z Tablet not found by adb
  • How to recover from a Spring Social ExpiredAuthorizationException
  • ILMerge & Keep Assembly Name
  • Cassandra Data Model
  • Arrow is showed instead of the material design version hamburger icon. Why doesn't syncState in
  • Large data - storage and query
  • WOWZA + RTMP + HTML5 Playback?
  • Codeigniter doesn't let me update entry, because some fields must be unique
  • Hits per day in Google Big Query
  • Why joiner is not used after Sequence generator or Update statergy
  • FormattedException instead of throw new Exception(string.Format(…)) in .NET
  • Exception on Android 4.0 `android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode)`
  • File not found error Google Drive API
  • Linking SubReports Without LinkChild/LinkMaster
  • Is it possible to post an object from jquery to bottle.py?
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • How to get NHibernate ISession to cache entity not retrieved by primary key
  • How to load view controller without button in storyboard?