Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- ....
- "key": "val1",
- ....
- "array" :[
- {
- "k":"v1",
- "rejected":"0"
- },
- {
- "k":"v2",
- "rejected":"0"
- }
- ]
- .....
- }
- var val1="val1";
- var v1="v1";
- request.put('https://api.mlab.com/api/1/databases/DB/collections/doc?q={"key": "'+val1+'","array.k":"'+v1+'"}&apiKey=.....',
- { json: { "$set": {"rejected": "1"}
- } },
- function (error, response, body) {
- if (!error && response.statusCode == 200) {
- console.log("----->Insertion"+body);
- return res.status(200).send("[{"status":"success"}]");
- }
- else
- {console.log(JSON.stringify(response));}
- });
- {
- ....
- "key": "val1",
- ....
- "array" :[
- {
- "k":"v1",
- "rejected":"0"
- },
- {
- "k":"v2",
- "rejected":"0"
- }
- ]
- .....
- "rejected":"1"
- }
Add Comment
Please, Sign In to add comment