I can't read the document afterwards, because the _lock field will exists whatever the update updated or not the document.
Thanks for your help !
Best Answer
C
Customer Support
said
over 6 years ago
Hi Eric,
You could use findAndModify in place of update with the same parameters, this will return the document which matches the query provided, from which you can get the id.
Try this out and let us know how it works for you.
You could use findAndModify in place of update with the same parameters, this will return the document which matches the query provided, from which you can get the id.
Try this out and let us know how it works for you.
Eric Moncada
I make an update of a mongoDB document in cloud code.
I need to know if the update did an update or if it didn't update because of the condition.
The return value of the update function is true or false, and returns true even if no document was updated.
In other word, I would like to test the "NO RESULT" that I get when I make the update from NoSQL.
My update :
myCollection.update({"_id": myId, { "_lock": { $exists: false }}, {$set:{"_lock":true}});
I can't read the document afterwards, because the _lock field will exists whatever the update updated or not the document.
Thanks for your help !
Hi Eric,
You could use findAndModify in place of update with the same parameters, this will return the document which matches the query provided, from which you can get the id.
Try this out and let us know how it works for you.
Regards,
Vinnie
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Eric,
You could use findAndModify in place of update with the same parameters, this will return the document which matches the query provided, from which you can get the id.
Try this out and let us know how it works for you.
Regards,
Vinnie
Eric Moncada
Thanks for the tip :)
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics