Skip to content

Commit

Permalink
use ensure index instead of simpleSchema
Browse files Browse the repository at this point in the history
so we can match the index name created with razeedash-api
  • Loading branch information
dalehille committed Feb 18, 2020
1 parent d85df8d commit 463afe3
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions imports/api/userLog/userLog.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Colletion to hold all user log entries

import { Mongo } from 'meteor/mongo';
import SimpleSchema from 'simpl-schema';
import { Meteor } from 'meteor/meteor';

export const UserLog = new Mongo.Collection('user_log');

Expand All @@ -11,11 +11,6 @@ UserLog.deny({
remove() { return true; },
});

const userLogSchema = new SimpleSchema({
userid: { type: String, index: true },
action: { type: String, index: true },
message: { type: String, required: true },
created: { type: Date, required: true, },
});

UserLog.attachSchema(userLogSchema);
if ( Meteor.isServer ) {
UserLog._ensureIndex( { 'userid': 1, 'action': 1} );
}

0 comments on commit 463afe3

Please sign in to comment.