What is the difference between embedded map data type and a json value as a string data type

Hi,

I’m able to insert a json into a string column in orientdb and query based on json keys.

  1. In such case why do i need to model that as an linkmap or embeddedmap in orientdb?
  2. Similar case for an array of Json object inserted into a string column (as an alternate to linklist/set embedded list/set)

Which is preferred and performance optimized for a billion entry?

Queries i’ve tried
insert into MyGraphVertex(alternateColToMap) values ({“firstName”:“Lakshmi”,“lastName”:“V”,“age”:23})

select alternateColToMap.age from MyGraphVertex where alternateColToMap.firstName=‘Lakshmi’

Hi @vivek

If you want to store a JSON object, the best way is to use EMBEDDEDMAP as a property type. If the “schema” of the embedded object is well known, you can also use EMBEDDED type. Make sure you define the property in the schema, so that OrientDB checks the type is correct, eg.

CREATE PROPERTY MyGraphVertex.alternateColToMap EMBEDDEDMAP

Anyway, it is not strictly needed, you can also work completely schemaless.

The queries you are entering are correct

Thanks

Luigi