How to define and store Map data as a predicate

Hi I am new to Dgraph, I wanted to store the data of a custom table where the user can give N number of fields that should be stored in a single predicate. How can I achieve this in Dgraph

thank you !

Hi @teja! Welcome to Dgraph!

Can you tell me how does your data look like? Is it always the same N fields?

One way would be to store a JSON object as the value for the given predicate. But you would not be able to do any meaningful indexing with that on inner values.

Yes, I would prefer to store it as a JSON Object, since I am not looking to index this predicate .

for this, should I use the type as default or else do I need to convert the object to string ?

From the docs, Dgraph will try to infer the type.

Dgraph automatically detects the data type of its predicates. You can see the auto-detected data types using the Ratel UI.

Though you can put it as string while defining the schema just to be sure.