BleartRamadaniOriginal post
Web Developer
After updating to the latest Appwrite version, I noticed that many-to-many relationship fields are no longer returned when using listDocuments. Previously, I would get the full objects, but now the fields seem to be missing entirely.
const demo = await databases.listDocuments("DATABASE ID", "COLLECTION ID")
console.log(demo.documents)
Expected output (old behavior):
[
{
"$id": "some-id",
"many-to-many-relation": [
{ "$id": "123", "name": "John Doe" },
{ "$id": "456", "name": "Jane Doe" }
],
"other-relations": { "$id": "some-id", "title": "Frontend Developer" }
}
]
Actual output (new behavior):
[
{
"$id": "some-id",
"other-relations": "some-id"
// many-to-many-relation is missing completely
}
]
Summary
After updating Appwrite, many-to-many relationship fields are no longer returned in listDocuments. This seems to be a bug in the latest version. Developers are urged to open an issue on GitHub for further investigation.