timshannon / badgerhold

BadgerHold is an embeddable NoSQL store for querying Go types built on Badger
MIT License
515 stars 52 forks source link

Enhance documentation for field names #34

Closed ivanjaros closed 3 years ago

ivanjaros commented 3 years ago

As I read through the documentation, you are using GOB by default and the field names in queries have upper-case first letter which I think means that the fields used in queries must match the de/serializer. So if one would use json then the field names in queries would be most likely all lower-cased. If this asumption is correct, I think it should be mentioned in the documentation that for queries, one should use field names the serializer uses itself and not struct fields, by default.

timshannon commented 3 years ago

That's all determined by the encoding you use. I default to Gob, but you can use any encoding that generates a byte slice.

You specify the encoder in the options when opening a DB: https://github.com/timshannon/badgerhold/blob/master/store.go#L36

ivanjaros commented 3 years ago

...well yes...thats what i said...