Skip to content

Problems on chaining count with where in array plus limit #35

@kolbma

Description

@kolbma

How do I chain this?

.count({ x: { $in: ['a','b'] }, u }).limit(1).exec()

I've tried

mock.expects('count')
      .chain('limit')
      .chain('exec')
      .resolves(1);

Result:

    ExpectationError: Unexpected call: count({
      x: { $in: ['a','b'] },
      u: 012345678901234567891234
    })
        Expectation met: count([...]) once

I've also tried different chain orders.
I've also tried with

.count({ u }).where('x').in(['a','b']).limit(1).exec()

chaining also where and in and again different order combinations.
Doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions