Giter Club home page Giter Club logo

Comments (7)

Pogix3m avatar Pogix3m commented on June 9, 2024 1

starting from mongodb 3.4, it use .project() for selecting fields

from feathers-mongodb.

jansel369 avatar jansel369 commented on June 9, 2024 1

After I changed the codes to

    if (filters.$select) {
      q = this.Model.find(query).project(this._getSelect(filters.$select));
    }

thanks to @Pogix3m now finally works on my project without a problem. Some of the unit test associated with $select breaks for this module.

from feathers-mongodb.

daffl avatar daffl commented on June 9, 2024

Are you sure you are not changing the query somehow in a hook? This is being tested in https://github.com/feathersjs-ecosystem/feathers-service-tests/blob/master/src/common-tests.js#L229 and I just double checked that it still works with latest master.

from feathers-mongodb.

jansel369 avatar jansel369 commented on June 9, 2024

I cloned this repo then made some test and they all work just fine with mongodb v3.6.2 . I tried using $select query to three different services of my project without any modification to query object of params but they give the same result of returning all the fields. Other query like $limit and $sort has no problem.

from feathers-mongodb.

daffl avatar daffl commented on June 9, 2024

If the build is still passing I'd be happy to accept a pull request with that change.

from feathers-mongodb.

jansel369 avatar jansel369 commented on June 9, 2024

Seems like fixes for this issue has been made but not included to the latest module. Though I just eliminated the recreation of a new cursor object.

from feathers-mongodb.

daffl avatar daffl commented on June 9, 2024

Closed via #111

from feathers-mongodb.

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.