Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Database
Created by Guest
Created on Sep 26, 2024

Is there any limitation on size of query in pipeline (character in query, not data)

I have an aggregate query, when the character in pipeline over 21066 character, the result return wrong format that the pipeline expected. So I wonder is there any limitation on size of query in pipeline? My case is: Query: [ "$match":{"profileID": {"$in": ['', .....]}}, {"$group":{"_id":"$profileID","materialLevel2":{"$sum":{"$cond":[{"$and":[{"$eq":["$expenseL2","true"]},{"$eq":["$expenseL3","false"]},{"$eq":["$expenseL4","false"]}]},1,0]}},"materialLevel3":{"$sum":{"$cond":[{"$and":[{"$eq":["$expenseL3","true"]},{"$eq":["$expenseL4","false"]}]},1,0]}},"materialLevel4":{"$sum":{"$cond":[{"$eq":["$expenseL4","true"]},1,0]}}}} ] The true result is: [{ "_id" : "000.03.50.H29", "materialLevel2" : 1.0, "materialLevel3" : 1.0, "materialLevel4" : 2.0 },...] But when the length of query greater than 21066 character, the result of query is: [{ "profileID" : "00.00.00.PTT", "expenseL2" : "true", "expenseL3" : "true", "expenseL4" : "false" },....] Thanks!
  • Attach files