This more like a "hey is this the way mongoose / mongodb works" as oppose to a how do I do this?
Let me specify though :
Model.find({name:'jim'}, function(err, jim){
// i should happen first & find 0 jim's
new Model({name:'jim'}).save( ... );
});
Model.find({name:'jim'}, function(err, jim){
// i should happen second & find 1 jim
new Model({name:'jim'}).save( ... );
});
I would like to have everything inside of the find to belay any future inserts to that model until the new model is saved. Any thoughts?