admin管理员组文章数量:1395780
i cant get this query to work:
<PaginatedCollection
service="users"
query={{
$facet: {
membersFirst: [
{ $addFields: { isMember: { $in: ["$_id", team.members || []] } } },
{ $sort: { isMember: -1, createdAt: -1 } }
]
}
}}
table={MemberTable}
tableOptions={{ user, translate, languages }}
filter={(query, value) => (query.email = { $regex: value })}
filterPlaceholder={"Filter by email"}
/>
Im fairly new to featherjs and react so the problem might be obvious, but it keeps saying Invalid parameter. this is the service in the backend:
// Initializes the `users` service on path `/users`
const { Users } = require("./users.class");
const createModel = require("./users.model");
const hooks = require("./users.hooks");
module.exports = function(app) {
const options = {
Model: createModel(app),
paginate: app.get("paginate"),
query: {
$sort: true,
$skip: true,
$limit: true,
$facet: true
}
};
// Initialize our service with any options it requires
app.use("/users", new Users(options, app));
// Get our initialized service so that we can register hooks
const service = app.service("users");
service.hooks(hooks);
service.publish((data, context) => {
return app.channel(`users/${data._id}`, `users/${data.coachId}`, `admins`);
});
};
what i wanna achieve is to show all the users, but show the team members first
I tried to enable the $ parameters, thinking thats why it says its invalid but still didnt work, not sure what else to do
本文标签: reactjsHow do i get facet to work in reactfeatherjsStack Overflow
版权声明:本文标题:reactjs - How do i get $facet to work in reactfeatherjs? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744705955a2620844.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论