0

I'm use find in mongodb by array, but I don't know max count of array may be.

collection.find(test: {$in: [1,2...n]}).

No more than how many could be n ? Please help me, if you sare links on documentation, it will best wonderful.

Awesome
  • 33
  • 5
  • Check this link, it has the way to find the element by key: https://stackoverflow.com/questions/7811163/query-for-documents-where-array-size-is-greater-than-1 – VivekTamilarasan Apr 28 '20 at 07:13
  • Thanks you, but its not what i need – Awesome Apr 28 '20 at 07:54
  • 1
    Are you asking if there is a limit to the number of elements in the array passed to the `$in` operator? If so, the answer is no, but sort of yes. The entire query is a BSON document, and therefore cannot be larger than 16MB total, so you should be able to fit a pretty good array in there. – Joe Apr 28 '20 at 08:53
  • Thanks you, you can write it in answer – Awesome May 06 '20 at 10:02

0 Answers0