Git Product home page Git Product logo

Comments (2)

steffenmllr avatar steffenmllr commented on July 26, 2024

Awesome. I'll check if it solves my problems. Btw. do you know https://github.com/meteor/meteor/blob/devel/packages/minimongo and https://github.com/louischatriot/nedb ?

It's another implementation of the same thing

from mingo.

kofrasa avatar kofrasa commented on July 26, 2024

Hi Steffen, am glad you find mingo useful and thanks for the report. I have resolved this bug and made a few corrections to your test case. The test function works per object instead of a collection. The find function is more appropriate instead.

var data = [{
      user: { username: 'User1', projects: [{ name: "Project 1", rating: { complexity: 6 }}, { name: "Project 2", rating: { complexity: 2 }}] }
    },{
      user: { username: 'User2', projects: [{ name: "Project 1", rating: { complexity: 6 }}, { name: "Project 2", rating: { complexity: 8 }}] }
    }];
    var query = {
      'user.projects': {
        "$all": [{
          "$elemMatch": {
            'rating.complexity': { '$gt' : 6 }
          }
        }]
      }
    };
    // It should return one user object
    var result = Mingo.find(data, query).count();
    equal(1, result, "can match using $all with $elemMatch on nested elements");

see commit f417c95

from mingo.

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.