TanmoySG / wunderDB

A micro JSON-based Data Store inspired by MongoDB.
http://wdb.tanmoysg.com/api/
Apache License 2.0
11 stars 0 forks source link

[Design and Development] Data Fields as Primary Key/Identifier in-place of `_id` #111

Closed TanmoySG closed 11 months ago

TanmoySG commented 1 year ago

Currently, _id is generated and used as primary identifier for a data-row(?). For example, now for data inserted , the Primary ID

{
  "name" : "T",
  "student_id" : 0123,
  "age": 21
}

the Identifier is random generated identifier _id,

{
  "axo0193nc4101383" : {"name" : "T", "student_id" : 0123, "age": 21},
}

For advanced use-cases, user might want to use any of the field values as identifier instead of _id. Eg instead of _id we want to use student_id as primary key.

{
  "0123" : {"name" : "T", "student_id" : 0123, "age": 21},
}

Possible solutions