Skip to content

Commit

Permalink
adding two keys
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancisZamora committed Jul 9, 2018
1 parent a3e5cfc commit 2520d4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/models/analytic.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class Analytic extends AnchorModel {

static async create(event,name,data,userId) {

const self = this;

Assert.ok(event, 'Missing event argument');
Assert.ok(name, 'Missing name argument');
Expand All @@ -23,7 +22,7 @@ class Analytic extends AnchorModel {

});

const analytics = await self.insertOne(document);
const analytics = await this.insertOne(document);

return analytics[0];

Expand All @@ -50,7 +49,8 @@ Analytic.payload = Joi.object({
});

Analytic.indexes = [
{ key: { userId: 1 } }
{ key: { event: 1 } },
{ key : { email: 1 } }
];

module.exports = Analytic;
Expand Down

0 comments on commit 2520d4b

Please sign in to comment.