Created
July 4, 2012 14:52
-
-
Save TylerBrock/3047768 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
#!/usr/bin/env mongo --quiet | |
var m = new Mongo(); | |
var db = m.getDB('test'); | |
var t = db.getCollection('whatever'); | |
t.find( { group:3, 'x.a':1 }, { 'x.$':0 } ); | |
printjson(db.getLastErrorCmd()); | |
assert.eq( 16345, db.getLastErrorCmd().code, "exclusion of positional operator" ); |
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
#!/usr/bin/env mongo --quiet | |
var m = new Mongo(); | |
var db = m.getDB('test'); | |
var t = db.getCollection('bunk'); | |
t.ensureIndex({a:1},{unique: true}); | |
t.insert({a: 1}); | |
t.insert({a: 1}); | |
printjson(db.getLastError()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment