mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
improve spacing
This commit is contained in:
@@ -42,7 +42,9 @@
|
||||
var uuid='30fb2640-7121-4968-ace5-f385e60ea6c5';
|
||||
|
||||
db.users.aggregate([
|
||||
{$match: {'_id': uuid} },
|
||||
{$match: {
|
||||
'_id': uuid
|
||||
}},
|
||||
{$project: {
|
||||
'_id':0, 'todos':1
|
||||
}},
|
||||
@@ -51,17 +53,17 @@ db.users.aggregate([
|
||||
_id: { taskid: '$todos.id' },
|
||||
count: { $sum: 1 }
|
||||
}},
|
||||
{ $match: {
|
||||
{$match: {
|
||||
count: { $gt: 1 }
|
||||
}},
|
||||
{ $project: {
|
||||
{$project: {
|
||||
'_id.taskid':1,
|
||||
}},
|
||||
{$group: {
|
||||
_id: { taskid: '$todos.id' },
|
||||
troublesomeIds: { $addToSet: "$_id.taskid" },
|
||||
}},
|
||||
{ $project: {
|
||||
{$project: {
|
||||
'_id':0,
|
||||
troublesomeIds:1,
|
||||
}},
|
||||
@@ -73,8 +75,8 @@ db.users.aggregate([
|
||||
db.users.update({
|
||||
'_id': uuid,
|
||||
'todos': { $elemMatch: { id: taskid } }
|
||||
},
|
||||
{ $set: { "todos.$.id" : 'de666' }
|
||||
},{
|
||||
$set: { "todos.$.id" : 'de666' }
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -82,8 +84,7 @@ db.users.aggregate([
|
||||
|
||||
db.users.update(
|
||||
{'_id': uuid},
|
||||
{ $pull: { todos: { id: 'de666' } } },
|
||||
{ multi: false }
|
||||
{$pull: { todos: { id: 'de666' } } },
|
||||
{multi: false }
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user