Comments (8)
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
from mquery.
sounds good to me
from mquery.
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?
from mquery.
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.
from mquery.
so you need access to the fields/options etc? we could expose that.
from mquery.
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
from mquery.
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
from mquery.
that sounds good for now. maybe nice to provide a clean env abstraction which provides the collection,objectid,readpref etc.
from mquery.
Related Issues (20)
- Feature: Add ability to run transform/map function on every function that returns a doc/docs. HOT 2
- Array sort options are not parsed correctly
- Add support for findOneAndReplace? HOT 2
- Several problems about shell and node-mongodb-native compatibility HOT 2
- "collection.count is deprecated" HOT 1
- How to search collection with keyword? HOT 1
- Feature Request: Subclass Promise HOT 1
- mquery().count(match) works?
- getting (node:92426) DeprecationWarning: collection.update is deprecated. when running with Node 14.5.0 HOT 2
- server deploy broken HOT 4
- Typescript support HOT 2
- Prototype Pollution is still possible in the latest version 3.2.4 HOT 1
- DriverInfo attribution
- Time to remove bluebird? HOT 2
- Support MongoDB driver 4.x HOT 1
- replace util.isArray with Array.isArray HOT 3
- Aggregate method HOT 2
- How to `mquery.or` multiple queries? HOT 1
- npm install mquery - not working! HOT 1
- Aggregation Support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mquery.