one:PRIMARY> use local
|
switched to db local
|
one:PRIMARY> db.foo.insert({_id:'filler'})
|
WriteResult({ "nInserted" : 1 })
|
one:PRIMARY> x = db.foo.mapReduce(function() {emit(this._id, ":(")}, (key, values)=> values[0], {out: {merge:'oplog.rs'}})
|
{
|
"result" : "oplog.rs",
|
"timeMillis" : 12,
|
"counts" : {
|
"input" : 1,
|
"emit" : 1,
|
"reduce" : 0,
|
"output" : 17
|
},
|
"ok" : 1
|
}
|
one:PRIMARY> db.oplog.rs.find({_id: 'filler'})
|
{ "_id" : "filler", "value" : ":(" }
|
This only happens on mmapv1 because wiredtiger rejects oplog entries without a ts field and there is no way to get one out of mapreduce.
|