neo4j - how do I model node schema less?

筅森魡賤 提交于 2019-12-08 05:52:46

问题


I read some where that noe4j or other nosql database is schemaless. so what is the schemaless? I would like to know more about it with use case.


回答1:


You don't need to define a schema like you would have to do e.g. in mysq with a table. Instead, you can add properties and their value to each individual node (entry), as you like.

E.g: if you look at the address book in an android phone a person entry can have a multitude of properties - phone numbers, addresses, names. Some people have a lot of attributes, some have none.

Doing something like that with a schema (e.g. table structure) is really hard, and requires advance planning of what your fields are, and how you want to query them in the future.

Without a schema you can more or less play it by ear, and add things as needed.

What needs deciding though is what to add as property to a node, and what as a related node. E.g. is an address a node, or just a property of a person? (Most likely a seperate node, but it depends on your use case)



来源:https://stackoverflow.com/questions/17880868/neo4j-how-do-i-model-node-schema-less

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!