New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different results when using historyFilters with model #226

Closed
radswiat opened this Issue Mar 21, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@radswiat
Copy link

radswiat commented Mar 21, 2017

Expected behavior

let draftRows = model.find( { status: 'draft' }, {
compose: true,
includeHistory: true,
historyFilters: '{ "status": "staged" }'
});

should return:

      "_id": "58b98bfbb0614bb42e293874",
      "documentId": "ObjectId(58b98bfab0614bb42e293860)",
      "categoryId": "ObjectId(a168865c-674d-48d8-9196-a14d41728a0c)",
      "status": "draft",
      ...
      "history": [
        {
          "_id": "58d100c2010183b49209fc26",
          "documentId": "ObjectId(58b98bfab0614bb42e293860)",
          ....
        }
}

Actual behavior

      "_id": "58b98bfbb0614bb42e293874",
      "history": [
        {
          "_id": "58d100c2010183b49209fc26",
          "documentId": "ObjectId(58b98bfab0614bb42e293860)",
          ....
        }
}

Parent is missing data, it only have _id, when documentId, categoryId, status are gone.

All works fine when using url query:
127.0.0.1:3001/1.0/presales/documentRows?filter={"status":"draft"}&includeHistory=true&historyFilters={"status":"staged"}

Package details

1.15.4
Windows

@jimlambie

This comment has been minimized.

Copy link
Member

jimlambie commented Mar 29, 2017

Hi @radswiat, yes, this is definitely a bug. I've started working on this one, hopefully will have a patch released soon. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment