Skip to content

Commit 7284f2d

Browse files
committed
[views] correctly call aggregation
1 parent 2e27a29 commit 7284f2d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugins/views/tests.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ describe('Testing views plugin', function() {
544544
describe('Validating user merging', function() {
545545
it('getting Info about users', function(done) {
546546

547-
db.collection("app_userviews" + APP_ID).aggregate({$lookup: {from: "app_users" + APP_ID, localField: "_id", foreignField: "uid", as: "userinfo"}}, function(err, res) {
547+
db.collection("app_userviews" + APP_ID).aggregate([{$lookup: {from: "app_users" + APP_ID, localField: "_id", foreignField: "uid", as: "userinfo"}}], function(err, res) {
548548
for (var k = 0; k < res.length; k++) {
549549
if (res[k].userinfo && res[k].userinfo[0]) {
550550
userObject[res[k].userinfo[0].did] = res[k];
@@ -573,7 +573,7 @@ describe('Testing views plugin', function() {
573573
});
574574

575575
it('validating result', function(done) {
576-
db.collection("app_userviews" + APP_ID).aggregate({$lookup: {from: "app_users" + APP_ID, localField: "_id", foreignField: "uid", as: "userinfo"}}, function(err, res) {
576+
db.collection("app_userviews" + APP_ID).aggregate([{$lookup: {from: "app_users" + APP_ID, localField: "_id", foreignField: "uid", as: "userinfo"}}], function(err, res) {
577577
var userObject2 = {};
578578
for (var k = 0; k < res.length; k++) {
579579
if (res[k].userinfo && res[k].userinfo[0]) {
@@ -608,7 +608,7 @@ describe('Testing views plugin', function() {
608608
});
609609

610610
it('validating result', function(done) {
611-
db.collection("app_userviews" + APP_ID).aggregate({$lookup: {from: "app_users" + APP_ID, localField: "_id", foreignField: "uid", as: "userinfo"}}, function(err, res) {
611+
db.collection("app_userviews" + APP_ID).aggregate([{$lookup: {from: "app_users" + APP_ID, localField: "_id", foreignField: "uid", as: "userinfo"}}], function(err, res) {
612612
var userObject2 = {};
613613
for (var k = 0; k < res.length; k++) {
614614
if (res[k].userinfo && res[k].userinfo[0]) {
@@ -644,7 +644,7 @@ describe('Testing views plugin', function() {
644644
});
645645

646646
it('validating result', function(done) {
647-
db.collection("app_userviews" + APP_ID).aggregate({$lookup: {from: "app_users" + APP_ID, localField: "_id", foreignField: "uid", as: "userinfo"}}, function(err, res) {
647+
db.collection("app_userviews" + APP_ID).aggregate([{$lookup: {from: "app_users" + APP_ID, localField: "_id", foreignField: "uid", as: "userinfo"}}], function(err, res) {
648648
var userObject2 = {};
649649
for (var k = 0; k < res.length; k++) {
650650
if (res[k].userinfo && res[k].userinfo[0]) {

0 commit comments

Comments
 (0)