Scenario: I have a collection of documents in MongoDB, which have a field called "arrayField" that contains an array of numbers. I have an array of numbers [1, 2, 3], and I want to query this collection to return all documents where the contents of the array field contain at least one (not necessarily all) of the elements of [1, 2, 3]. So for instance, if one of the documents has [1, 6, 7] in arrayField, it would be returned.
How to properly formulate the search options for .find() to perform such a query? I tried {'arrayField': { $in: [1, 2, 3]} }, but that only returns documents where the arrayField has only one element -- just [1] or just [2] or just [3].
$inoperator will filter the document that with any value match in the input array.