apostrophe
apostrophe copied to clipboard
"and" filter method not working with joinByOne or joinByArray
The filters and options not work.
{
name: "_best_product",
withType: "product",
type: "joinByOne",
filters: {
and: { score: { $gte: 5 } },
projection: {
title: 1,
slug: 1,
type: 1,
tags: 1
}
}
}
To Reproduce I created a git to run a test: https://github.com/FerX/apostrophe-test-and
Steps to reproduce the behavior:
- clone git
- npm install
- create user admin
- run project
- add many piece products with score from 1 to 10
- in the home page, open Page Settings
- tab info - best product - Browse
- you will see that it displays all the pieces and not filtered based on the AND rule entered in lib/modules/home-pages/index.js
Expected behavior list of products with score >=5
Describe the bug the and filter is not used to compose the mongodb filters
Version of Node.js v11.15.0
Server Operating System Linux Debian stable