Back

Query number of values in Array attribute

  • 0
  • Self Hosted
  • Flutter
  • Databases
YahalomS
29 Aug, 2024, 11:38

Working on Self-Hosted Server (version 1.5.10) with Flutter project. Hi, I have a collection with Array of Strings attribute. I would like to create a query of all the documents where the number of values in the array are, let's say, more than 1 value. It goes further, since I would like to have a query for documents that has more than 3 and less than 7. Is there a way to do in ?

TL;DR
Developers working on a Flutter project on a Self-Hosted Server (version 1.5.10) want to query documents based on the number of values in an array attribute - - To query documents with more than 1 value in the array: db.collection.find({ 'arrayField': { $exists: true, $not: { $size: 1 } } }); - To query documents with more than 3 and less than 7 values in the array: db.collection.find({ 'arrayField': { $exists: true, $not: { $size: 1 } }, $expr
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more