Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Job.update(
- {estimateSet: {"$elemMatch": {_id: estimateId}}},
- {$push:
- {
- "estimateSet.$.lineItemSet":
- {
- '_id': lineItem._id,
- 'measurements' : lineItem.measurements,
- 'quantity' : parseInt(lineItem.quantity),
- 'installPrice' : lineItem.installPrice,
- 'productId' : lineItem.productId,
- }
- }
- },
- {upsert: true ,safe:true},
- function (err, numberAffected, raw) {
- console.log("err: ", err);
- console.log("numberAffected: ", numberAffected);
- console.log("raw: ", raw);
- err ? res.send({"error": true}) : res.send({"error": false});
- }
- );
Add Comment
Please, Sign In to add comment