![](https://cdn.discordapp.com/avatars/218461850298220546/e04650ba05431248cbe91b7ca439737e.webp)
in https://appwrite.io/docs/products/databases/relationships#create-documents we create a spiderman movie, with unique ID. ```js const { Client, Databases, ID } = require('node-appwrite');
const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('<PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
await databases.createDocument(
'marvel',
'movies',
ID.unique(),
{
title: 'Spiderman',
year: 2002,
reviews: [
{ author: 'Bob', text: 'Great movie!' },
{ author: 'Alice', text: 'Loved it!' }
]
}
)
but in the next update section, we update by passing title? not ID?
js
const { Client, Databases } = require('node-appwrite');
const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('<PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
await databases.updateDocument( 'marvel', 'movies', 'spiderman', { title: 'Spiderman', year: 2002, reviews: [ 'review4', 'review5' ] } ); ``` how does this work?
![](https://cdn.discordapp.com/avatars/186656408450629633/ca3bdd514fde110c200d8e9cff0c1328.webp)
That wouldn't work, I think it could be displayed like this to show in an easier to digest way that if you want to update the spiderman record use the ID for that record.
![](https://cdn.discordapp.com/avatars/218461850298220546/e04650ba05431248cbe91b7ca439737e.webp)
might suggest then writing spiderman_ID so no questions would raise
![](https://cdn.discordapp.com/avatars/218461850298220546/e04650ba05431248cbe91b7ca439737e.webp)
idk maybe its just me
![](https://cdn.discordapp.com/avatars/218461850298220546/e04650ba05431248cbe91b7ca439737e.webp)
@Kenny i got another question you might answer based on relationships, can we limit the depth that is showing?
![](https://cdn.discordapp.com/avatars/186656408450629633/ca3bdd514fde110c200d8e9cff0c1328.webp)
I don't think currently you can explicitly limit depth, but a depth of only 3 is shown.
![](https://cdn.discordapp.com/avatars/186656408450629633/ca3bdd514fde110c200d8e9cff0c1328.webp)
Relationships are still in beta and as such are lacking some crutial features, imo.
![](https://cdn.discordapp.com/avatars/218461850298220546/e04650ba05431248cbe91b7ca439737e.webp)
i would see depth control as a must
![](https://cdn.discordapp.com/avatars/218461850298220546/e04650ba05431248cbe91b7ca439737e.webp)
i got dashboard -> action -> job and action-> notification
![](https://cdn.discordapp.com/avatars/218461850298220546/e04650ba05431248cbe91b7ca439737e.webp)
so if any changes i get a refresh of all the data
![](https://cdn.discordapp.com/avatars/218461850298220546/e04650ba05431248cbe91b7ca439737e.webp)
i still want to keep the relationships, for administrative purposes
![](https://cdn.discordapp.com/avatars/218461850298220546/e04650ba05431248cbe91b7ca439737e.webp)
but the amount of incoming data might be overwhelming
![](https://cdn.discordapp.com/avatars/218461850298220546/e04650ba05431248cbe91b7ca439737e.webp)
dashboard could have like 30 actions, which could have about 150 notifications, that's a lot of data
![](https://cdn.discordapp.com/avatars/186656408450629633/ca3bdd514fde110c200d8e9cff0c1328.webp)
Yep, I agree. I've run into some limitations with relationships returning far too much data and making requests for documents take 30 seconds.
![](https://cdn.discordapp.com/avatars/218461850298220546/e04650ba05431248cbe91b7ca439737e.webp)
i love the nested creation though, could be awesome if this could be achieved with out relationships, maybe it is ?
![](https://cdn.discordapp.com/avatars/218461850298220546/e04650ba05431248cbe91b7ca439737e.webp)
i guess its not, how else would you know in which collection its supposed to go
![](https://cdn.discordapp.com/avatars/218461850298220546/e04650ba05431248cbe91b7ca439737e.webp)
oh and one last question, is there a way to limit what fields get back to the client ? like private field or something?
![](https://cdn.discordapp.com/avatars/218461850298220546/e04650ba05431248cbe91b7ca439737e.webp)
like graphql does, but with the sdk ?
![](https://cdn.discordapp.com/avatars/186656408450629633/ca3bdd514fde110c200d8e9cff0c1328.webp)
On the root document you can use the select query to only return specific columns. Query.select(["column_name"])
Recommended threads
- Server Error - 500 when Loading Messagin...
Hi, I'm self hosting on a VPS my appwrite database and was working towards setting up an SMTP server, when testing I got an error due to some mishaps with the S...
- Invalid token passed in the request by u...
Hi guys, I'm having this issue when passing the parameters userId and secret to **updateVerification**. I checked in Appwrite console and the email was verifie...
- Hi all, can someone help me with 2FA imp...
I am in need of help with implementation of 2FA method in my project.
![](/images/bgs/pre-footer.png)