matteodem / meteor-easy-search

Easy-to-use search for Meteor with Blaze Components
MIT License
438 stars 68 forks source link

MinimongoEngine is not a constructor #582

Closed hayk94 closed 7 years ago

hayk94 commented 7 years ago

I get this error on the client and there is no error on the server. I did everything as in the leaderboard example but still it doesn't seem to work.

Here are the code examples in case you need them this is my /imports/collections/Email.js


import { Mongo } from 'meteor/mongo'
import { check, Match } from 'meteor/check'

Meteor.methods({
  // TODO: Perform checks
  'emails.insert': function ({name, to, subject, html, attachments}) {
    check([name, to, subject], [String])
    return Emails.insert({
      createdAt: new Date(),
      ownerId: this.userId,
      name,
      to,
      subject,
      html,
      attachments
    })
  },
  'emails.update': function ({emailId, name, to, subject, html, attachments}) {
    return Emails.update(emailId, { $set: {
      createdAt: new Date(),
      ownerId: this.userId,
      name,
      to,
      subject,
      html,
      attachments
    }})
  },
  'emails.remove': function (emails) {
    return Emails.remove({_id: {
      $in: emails
    }})
  }
})

export const Emails = new Mongo.Collection('emails')

And this is my EmailsIndex.js


import { Emails } from './Emails.js'
import { Index, MinimongoEngine } from 'meteor/easy:search'

export const EmailsIndex = new Index({
  engine: new MinimongoEngine(),
  collection: Emails,
  fields: ['name']
})
matteodem commented 7 years ago

What version of easy search are you using?

hayk94 commented 7 years ago

easy:search@2.0.5 easysearch:components@2.0.5 easysearch:core@2.0.9

matteodem commented 7 years ago

updating to the latest version should help