mongoose-findorcreate icon indicating copy to clipboard operation
mongoose-findorcreate copied to clipboard

A plugin for Mongoose which adds the findOrCreate method to models

Results 5 mongoose-findorcreate issues
Sort by recently updated
recently updated
newest added

How can we return an object from it ``` ShopModule.createShop = async function (req, res) { try { const data = JSON.parse(req).shop; const shop = await Shop.findOrCreate({ shopify_domain: data.domain },...

========================= Controller ========================= const login = (req, res) => { console.log(req.headers, '-----') console.log(req.body.email, '=======') console.log(req.body.faceId, '=====erge==') User.findOrCreate( { faceId: req.body.faceId }, { username: req.body.username }, { email: req.body.email}, (err, result)...

The search params should use the same same validators as the Schema. For example, if my schema specifies: `{ name: { type: String, trim: true } }` I would like...

Would it be possible to return a promise when no callback was passed?

enhancement