Mongo error: “unknown top level operator: $completed_on” for aggregate
up vote
0
down vote
favorite
I am trying to perform aggregate operation with Mongo which is like follows:
db.inbound_documents.aggregate([{"$match":
{"$completed_on":
{"$gte":'2018-05-19 00:00:00',
"$lte":'2017-05-19 00:00:00'}}},
{"$group":
{"_id":"$completed_by","total":{"$sum":1}}}])
completed_on is available in the schema, Still I am not getting that why it is causing that error.
python-3.x mongodb pymongo
add a comment |
up vote
0
down vote
favorite
I am trying to perform aggregate operation with Mongo which is like follows:
db.inbound_documents.aggregate([{"$match":
{"$completed_on":
{"$gte":'2018-05-19 00:00:00',
"$lte":'2017-05-19 00:00:00'}}},
{"$group":
{"_id":"$completed_by","total":{"$sum":1}}}])
completed_on is available in the schema, Still I am not getting that why it is causing that error.
python-3.x mongodb pymongo
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to perform aggregate operation with Mongo which is like follows:
db.inbound_documents.aggregate([{"$match":
{"$completed_on":
{"$gte":'2018-05-19 00:00:00',
"$lte":'2017-05-19 00:00:00'}}},
{"$group":
{"_id":"$completed_by","total":{"$sum":1}}}])
completed_on is available in the schema, Still I am not getting that why it is causing that error.
python-3.x mongodb pymongo
I am trying to perform aggregate operation with Mongo which is like follows:
db.inbound_documents.aggregate([{"$match":
{"$completed_on":
{"$gte":'2018-05-19 00:00:00',
"$lte":'2017-05-19 00:00:00'}}},
{"$group":
{"_id":"$completed_by","total":{"$sum":1}}}])
completed_on is available in the schema, Still I am not getting that why it is causing that error.
python-3.x mongodb pymongo
python-3.x mongodb pymongo
asked Nov 8 at 8:25
arshpreet
1991418
1991418
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
just remove your $ sign before completed_on :
db.inbound_documents.aggregate([
{"$match":
{"completed_on":
{"$gte":'2018-05-19 00:00:00',
"$lte":'2017-05-19 00:00:00'}}},
{"$group":
{"_id":"$completed_by","total":{"$sum":1}}}])
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
just remove your $ sign before completed_on :
db.inbound_documents.aggregate([
{"$match":
{"completed_on":
{"$gte":'2018-05-19 00:00:00',
"$lte":'2017-05-19 00:00:00'}}},
{"$group":
{"_id":"$completed_by","total":{"$sum":1}}}])
add a comment |
up vote
1
down vote
just remove your $ sign before completed_on :
db.inbound_documents.aggregate([
{"$match":
{"completed_on":
{"$gte":'2018-05-19 00:00:00',
"$lte":'2017-05-19 00:00:00'}}},
{"$group":
{"_id":"$completed_by","total":{"$sum":1}}}])
add a comment |
up vote
1
down vote
up vote
1
down vote
just remove your $ sign before completed_on :
db.inbound_documents.aggregate([
{"$match":
{"completed_on":
{"$gte":'2018-05-19 00:00:00',
"$lte":'2017-05-19 00:00:00'}}},
{"$group":
{"_id":"$completed_by","total":{"$sum":1}}}])
just remove your $ sign before completed_on :
db.inbound_documents.aggregate([
{"$match":
{"completed_on":
{"$gte":'2018-05-19 00:00:00',
"$lte":'2017-05-19 00:00:00'}}},
{"$group":
{"_id":"$completed_by","total":{"$sum":1}}}])
answered Nov 8 at 10:04
matthPen
1,070166
1,070166
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203856%2fmongo-error-unknown-top-level-operator-completed-on-for-aggregate%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password