- Modified privacywrite query with graphLookup:
$graphLookup: {
from: "projects",
startWith: "$id_main_project",
connectFromField: "id_main_project",
connectToField: "_id",
as: "ris",
restrictSearchWithMatch: { $or: [{ privacyread: server_constants.Privacy.all }, { userId: userId }] }
}
},
{ $match: { "ris.privacyread": { $exists: true } } },
This commit is contained in:
@@ -55,9 +55,7 @@ var TodoSchema = new mongoose.Schema({
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
id_prev: {
|
||||
type: String,
|
||||
},
|
||||
id_prev: mongoose.Schema.Types.ObjectId,
|
||||
progress: {
|
||||
type: Number,
|
||||
},
|
||||
@@ -148,8 +146,10 @@ TodoSchema.statics.getAllTodo = async function (userId) {
|
||||
|
||||
const arrtodos = [];
|
||||
if (obj.arrcategories.length > 0) {
|
||||
for (let mycat in obj.arrcategories) {
|
||||
arrtodos.push(tools.mapSort(arralltodo.filter(item => item.category === obj.arrcategories[mycat])))
|
||||
for (const mycat of obj.arrcategories) {
|
||||
const arrfiltrato = arralltodo.filter(item => item.category === mycat);
|
||||
// console.log('arrfiltrato ', mycat, arrfiltrato);
|
||||
arrtodos.push(tools.mapSort(arrfiltrato))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user