carbon-io / carbond

MIT License
2 stars 5 forks source link

Review FindConfig Query Schema #275

Open tfogo opened 6 years ago

tfogo commented 6 years ago

The format here for query schemas:

https://github.com/carbon-io-examples/contacts-service-advanced/blob/d73011d6c0f2e5d66d0470b573e3fa563bfa6b3a/lib/ContactsEndpoint.js#L131-L133

Has been replaced by:

https://github.com/carbon-io/carbond/blob/master/lib/mongodb/MongoDBFindConfig.js#L71

which is far more verbose. We may want to look into other ways of doing it?

willshulman commented 6 years ago

It is more verbose but I think it is clear enough. This does however, make me wonder if this should be a MongoDBCollection vs just a Collection. Seems to me that MongoDBCollection implies that the query language is the MongoDB query language even though it is possible to change that via configuration (e.g. we can technically change the schema of the "query" parameter to not be an object -- but should we?). Adding @gregbanks to discussion.