Hi I was looking if I could search into a array with the Query feuture. I saw Query.equal("accounts", [accountId]) would work but it doesnt seem to return anything
Tried this:
let listings = await databases.listDocuments(
process.env.LISTING_DB_ID,
process.env.FUNDS_COLLECTION_ID,
[
Query.equal("accounts", [accountId])
]
);
console.log([accountId])
console.log(listings)
But it returns 0 documents but I know accounts one has a document that has a array with that accountId
So it returns:
{ total: 0, documents: [] }
[ '656dd1ecc45f5eade4ec' ]
And if I remove the Query.equal:
{
total: 1,
documents: [
{
lister: '65269bd3282ac32a18e9',
accounts: [ '656dd1ecc45f5eade4ec' ],
amount: 150,
verified: false,
tags: [Array],
payment_methods: [Array],
paid: [],
listed: true,
locked_until: null,
sold_amount: 0,
price: 1200,
'$id': '656dd307df95b6b7b7a0',
'$createdAt': '2023-12-04T13:24:23.916+00:00',
'$updatedAt': '2023-12-04T13:24:23.916+00:00',
'$permissions': [],
'$databaseId': '64ebb0361a869b05604d',
'$collectionId': '64ebbb7ec778217d8079'
}
]
}
[ '656dd1ecc45f5eade4ec' ]
Query inside array not working like expected
This is unsupported at the moment. 👍🏼 and see https://github.com/appwrite/appwrite/issues/2838
but why does it work on $id or other related attributes to appwrite?
because $id is not an array
Recommended threads
- Appwrite SSL Certificate Failure
Hello, I need help releasing a stuck domain. My Domain: adilnaib.engineer My Project ID: 68fe0aee001e999b5d71 Error: Failed to add domain to Fastly: {"msg":"B...
- [BUG] I'm facing an issue while creating...
Here’s what’s happening: When I try to create a new Web app on my Appwrite console (backend.keplr.in), the browser console shows multiple errors: Uncaught (in...
- Sites: Old deployment gets requests even...
Hi team, I use Sites to host a Next.js web app and it serves from old deployment for many hours. Is this expected? I thought it would serve from new deployment ...