This operation is not allowed, Current connection is readonly when use mapreduce
Answered
db.loan.mapReduce(
function () {
var stats = {
"xxx":0,
"xxx":0,
"xx":0,
};
xxxx
emit(123.length, 345);
},
function (key, values) {
var reducedStats = {
"xxx":0,
"xxx":0,
"xxx":0,
};
xxxxx
return reducedStats;
},
{
out: { inline: 1 },
query: {loanCategory:"CONSUMER", datePublished:{$exists: true}},
sort: {},
}
)
Why it shows This operation is not allowed, Current connection is readonly.
In MongoDB, the map-reduce operation is a mutable command. The map-reduce operation can write results to a collection or return the results inline. To use it, you have to turn off the read-only locker.
In MongoDB, the map-reduce operation is a mutable command. The map-reduce operation can write results to a collection or return the results inline. To use it, you have to turn off the read-only locker.
Replies have been locked on this page!