- 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:
@@ -215,19 +215,25 @@ module.exports = {
|
||||
// console.log('currentId', currentId);
|
||||
sortedList.push(item);
|
||||
} else {
|
||||
map.set(item.id_prev, i);
|
||||
map.set(String(item.id_prev), i);
|
||||
}
|
||||
}
|
||||
|
||||
while (sortedList.length < linkedList.length) {
|
||||
// get the item with a previous item ID referencing the current item
|
||||
var nextItem = linkedList[map.get(currentId)];
|
||||
if (nextItem === undefined)
|
||||
if (nextItem === undefined) {
|
||||
break;
|
||||
}
|
||||
sortedList.push(nextItem);
|
||||
currentId = String(nextItem._id);
|
||||
}
|
||||
|
||||
if (sortedList.length < linkedList.length) {
|
||||
console.log('ATTENZIONE !!! ', sortedList.length, linkedList.length);
|
||||
}
|
||||
|
||||
|
||||
// console.log('DOPO sortedList', sortedList);
|
||||
|
||||
return sortedList;
|
||||
|
||||
@@ -15,7 +15,7 @@ module.exports = Object.freeze({
|
||||
|
||||
|
||||
LIST_END: '10000000',
|
||||
LIST_START: '0',
|
||||
LIST_START: null,
|
||||
|
||||
Privacy: {
|
||||
all: 'all',
|
||||
|
||||
Reference in New Issue
Block a user