Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

structured (type-safe) queries. #19

Open
gregwebs opened this issue Feb 23, 2012 · 1 comment
Open

structured (type-safe) queries. #19

gregwebs opened this issue Feb 23, 2012 · 1 comment

Comments

@gregwebs
Copy link

BSON is just an AList, which is find. However, MongoDB has specific semantics not captured in allowing arbitrary strings. The current driver will let you throw anything at it and hopefully report an error. We need a structure built by data constructors: Set instead of "$set", etc.

This might be a cumbersome or inefficient way to construct queries. However, this query data type can be used to validate a query at compile time instead of being a direct interface for the user (I would be willing to create such a package).

MongoDB is fairly well documented for an end user figuring out how to make a query, but we really need to know the same grammar that MongoDB uses. Can you provide this?

@TonyGen
Copy link
Owner

TonyGen commented Feb 24, 2012

You should ask about the grammar on the mongo mailing list. From what I've seen there is no formal grammar, it is implicit in the code (inside switch statements and other conditionals).

Feel free to create a package for type safe queries. It would be great.

Cheers,
Tony

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants