
I would like to understand how to create an attribute in the database structure that allows me to store data of type key value, structure of type json, if possible I would like to learn how to do it.

can you provide more details about your use case?

I would like to have a rating of a series of books per user, for example something like this:
{ Userid: 1234567, DateStart: DD/MM/YYYY, qualification:{ book1 : 10, Book2: 3, Book3: 4, ....... Bookn : 10 } }

For the example I would like to save the ratings of each book in that structure.

The way this is typically done is to use a separate collection (say ratings) where that collection will have a bookId and rating attribute.

You can either use a relationship attribute for the user or manually use a string for the userId

Keep in mind, relationships are experimental at the moment

Thank you, it would be maintaining the relationship model. of SQL databases, although it would be good to include a json-type field as in supabase

Although it would be good to use a string field like json?

Some people do that. I don't recommend it because you wouldn't be able to query that

Thank you, steven
Recommended threads
- Creating a relationship with nested obje...
{ "data": { "name": "DiDi", "type": "Software Development", "userJobs": [{ "$id": "68cbf1e2003612fb13ca", "j...
- Realtime integration with SSR auth
Hey, I have a nextjs website with SSR auth, works great. I use a session client for user verification and an admin client with API key. Both is used with node-...
- Adding "name" column to table creates 2-...
As stated, im adding the "name" column to one table, it adds 4 duplicates. In another table it adds 3 duplicates, and when I delete 1 of them, all duplucates di...
