go-kivik / kivik

Common interface to CouchDB or CouchDB-like databases for Go and GopherJS
Other
316 stars 44 forks source link

driver: Find's query argument should be more consistent #1015

Open flimzy opened 4 months ago

flimzy commented 4 months ago

At present, it allows:

If query is a string, []byte, or [encoding/json.RawMessage], it should be treated as a raw JSON payload. Any other type should be marshaled to JSON.

This should be made more consistent. Either by passing a pre-parsed selector of some type (perhaps a *mongo.Selector?) or the raw JSON only.

Relates to #1014, and probably depends on it.