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

browser compatible #4

Open
aheckmann opened this issue Apr 23, 2013 · 8 comments
Open

browser compatible #4

aheckmann opened this issue Apr 23, 2013 · 8 comments

Comments

@aheckmann
Copy link
Collaborator

No description provided.

@tarqd
Copy link

tarqd commented Aug 18, 2013

To make this easier, I think the actual querying should be left out of this repo (remove the mongodb dependency) and allow passing any object that implements the collection interface or even just having this library simply generate valid query objects. For example I have my own fork that returns an object with the final query/updateDoc/options, which I then pass to a component that converts simple queries to RESTful urls to use client-side

@aheckmann
Copy link
Collaborator Author

sounds good to me

@tarqd
Copy link

tarqd commented Aug 20, 2013

Do you think it'd be better to return a query object or just have it so you pass a collection object to the library?

@aheckmann
Copy link
Collaborator Author

that's actually how it works today. we just wrap the passed collection in a compatibility layer. We should break the layer out and define it so its easy to create other compat layers.

@aheckmann
Copy link
Collaborator Author

so you need access to the fields/options etc? we could expose that.

@aheckmann
Copy link
Collaborator Author

Right now if you override mquery.Collection we'll use that instead but it must conform to the mquery collection API. take a look at lib/collection

@tarqd
Copy link

tarqd commented Aug 20, 2013

Only problem with a browser version is lib/utils.js currently requires mongodb (for ReadPref and ObjectId). I'd say have the collection define it (NodeCollection.ObjectId or NodeCollection.Types.ObjectId)

That way you can just define polyfills for those types for the browser/mongoshell

@aheckmann
Copy link
Collaborator Author

that sounds good for now. maybe nice to provide a clean env abstraction which provides the collection,objectid,readpref etc.

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

No branches or pull requests

2 participants