spring - How to create a model in Java for Dynamic mongodb Schema? -
with relational databases, create model in java since know how many columns table has , respective names. mongodb doesn't work such static schema(if i'm not wrong). so, want create model in java hold data , convert json , sent response web service.
but returning document or dbobject objects. it's converting id
"_id": { "timestamp": 1505194179, "machineidentifier": 13503772, "processidentifier": 3816, "counter": 1819499, "date": 1505194179000, "time": 1505194179000, "timesecond": 1505194179 }
where need id value further make network calls use identifier.
so want know best practice or strategy in order achieve this. use spring boot. i'me new mongodb spring boot. so, bear me if understanding wrong.
edit: in spring boot, it's necessary define entity class access data want know other way don't want model predefined should dynamic schema in mongodb.
Comments
Post a Comment