You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ve...@googlegroups.com
Hello All,
I am using vert.x 3.0.0 with MongoDB 3.0.4 for my application. I read the official document of vert.x MongoClient but I didn't find any method like, findAndModify(). MongoDB support this method, I want to update the collection and get back the updated value. I am unable to do this thing in vert.x. Can anyone have any idea around it or any alternative to achieve this. Please help me guys.
Thanks and Regards,
Hitesh
Paulo Lopes
unread,
Jul 2, 2015, 9:52:21 AM7/2/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ve...@googlegroups.com
findAndModify is not implemented on mongo-client and the java mongo-driver-async 3.0.2 does not seem to have that functionality built-in, you might need to break your code in 2 parts:
1) find the documents 2) perform the update
From the driver it seems that there is a FindOneAndReplace/findOneAndRemove but the findAndModify seems to be more generic that these 2 methods...
xunitc xc
unread,
Jul 2, 2015, 10:38:03 AM7/2/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ve...@googlegroups.com
hi, I think you can use:
def query = [
findAndModify: "table",
update: [ '$inc': [ "id": 1L ] ],
new: true,
upsert: false
];
mongo.runCommand("findAndModify", query, { result ->