Giter Club home page Giter Club logo

Comments (8)

tarqd avatar tarqd commented on August 21, 2024

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.

aheckmann avatar aheckmann commented on August 21, 2024

sounds good to me

from mquery.

tarqd avatar tarqd commented on August 21, 2024

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.

aheckmann avatar aheckmann commented on August 21, 2024

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.

aheckmann avatar aheckmann commented on August 21, 2024

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

from mquery.

aheckmann avatar aheckmann commented on August 21, 2024

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.

tarqd avatar tarqd commented on August 21, 2024

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.

aheckmann avatar aheckmann commented on August 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.