ostafen / clover

A lightweight document-oriented NoSQL database written in pure Golang.
MIT License
677 stars 54 forks source link

Why is the _id a uuid #149

Open singersbalm opened 6 months ago

singersbalm commented 6 months ago

Discussed in https://github.com/ostafen/clover/discussions/148

Originally posted by **singersbalm** March 19, 2024 Why can't I define a custom _id?. I tried to define a users collection with the email as _id to improve lookup performance. ``` func isValidObjectId(id string) bool { _, err := uuid.FromString(id) return err == nil } ``` Clover only allows uuids, but why. what's the benefit? Shouldn't that check be optional?