Created
August 2, 2015 20:53
-
-
Save horsey/c3f96f103b4477e250f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //variable data is JSON string | |
| db.collection('objects').update({ | |
| _key: key, | |
| 'secretary.username': options.username | |
| }, { | |
| $addToSet: { | |
| "secretary.$" : data | |
| } | |
| }, { | |
| upsert: true, w: 1 | |
| }, function(err, result) { | |
| if (err) { | |
| return cb(err, null); | |
| } | |
| return cb(null, result); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment