i'm pretty n00b in all mean stack so i need a little help with retriving data form mongodb an use it as var.i want to use it like this:var last_doc_id = db.getCollection('documents').find({}).sort({doc_id:-1}).limit(1); I need this because i'm writting doc_id to the db and I want to retrive the last doc_id that was used.And it would be great that the result of this query would be only string.Can anyone explain to me how can I achive that ?
Submitted May 05, 2017 at 10:28PM by When_The_Dank_Hits
No comments:
Post a Comment