camo icon indicating copy to clipboard operation
camo copied to clipboard

Documents broken? Update broken? save broken?

Open jlsjonas opened this issue 9 years ago • 2 comments

Camo looked like an interesting project, however I'm experiencing MAJOR issues with it... I declared a schema (extends document class) loosely based on Slack's user model (with some extra things added) however; using either findOneAndUpdate or instance.save() does note save to DB only the INITIAL creation is saved when using findOneAndUpdate in combination with upsert:true.

It's like only .create(), .find() and .findOne() are working as expected

Am I missing something obvious? or is there something badly wrong with camo?

jlsjonas avatar May 30 '16 07:05 jlsjonas

Have you got a code example?

For findOneAndUpdate I had to add the following option to insert a new record if it couldn't find one : {upsert: true}.

jamespegg avatar May 30 '16 12:05 jamespegg

@jlsjonas This is long overdue, but did you figure out your issue? I'd be happy to take a look at a code example if you're still having troubles. If not, please close the issue.

Thanks!

scottwrobinson avatar Jun 27 '16 22:06 scottwrobinson