javascript - Get back the mongo ObjectID when using $http POST in Angular -
i have mean stack application using $http.post add objects mongo database persisting in local array. there way of returning generated objectid (._id) attribute when post it?
i trying keep "pointers" in local array can them later.
i don't know how mean stack mongo driver working in many cases, when call insert passing javascript object, driver after successful insert modify object new generated objectid or _v field. generation of objectid in cases done driver , not mongodb server.
so in many cases returning same object post call give objectid.
maybe can print object after insert on console see if driver doing work or not. if it's doing can return same object response.
if isn't doing so, bad luck.
Comments
Post a Comment