hate to answer this but might help others!

-- from my research, mongodb generated ID is being done via client side, so no need to query this to sever side

Solution #1 Assign value to your ID

EX: val cID = new Object()

then include this in your save code

Solution #2 Let mongodb assign ID

EX: val comment = Comment(userId =, name=user.getNameString, text = text)

Then this will return all the info together with the generated ID. You can access the ID via (in my case).

Hope this will help others

Related Query

More Query from same tag