[SERVER-3769] unclear error message when $in is used with scalar instead of array Created: 06/Sep/11  Updated: 03/Dec/15  Resolved: 03/Dec/15

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Kristina Chodorow (Inactive) Assignee: Unassigned
Resolution: Done Votes: 0
Labels: query_triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

It could be a little more specific that you need to pass an array:

> db.foo.find({x:{$in:1}})
error:

{ "$err" : "invalid query", "code" : 12580 }

 Comments   
Comment by David Storch [ 03/Dec/15 ]

Fixed as of 2.6:

> db.c.find({x: {$in: 1}})
Error: error: {
	"$err" : "Can't canonicalize query: BadValue $in needs an array",
	"code" : 17287
}

Generated at Thu Feb 08 03:04:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.