Regression with db.ensureIndex feature with the new release 0.5

753 views
Skip to first unread message

jean-guillaume lalanne

unread,
Oct 18, 2012, 2:53:07 PM10/18/12
to meteo...@googlegroups.com
Hello, 

First of all, thanks a lot to the meteor's team for your awesome work !! This framework is surprising me more an more.

When I have got the new release annoucement , I urged to test it :). 
I have been nicely pleased by the new authentication/autorisation features.
Nevertheless I have got a regression on my application. I used geolocation mongo feature. So i used to fix my mongo db index in the startup.js server file with the following line " XXXX._driver.mongo.db.ensureIndex". But in the new release it does not work anymore. I am getting the following error : "TypeError: Cannot read property 'mongo' of undefined". I don't know where to search in the meteor source to find out a work around. I have got a look to the mongo_driver.js file but I am not completely sure how it is working. Has anyone an idea ? Thanks in advance for your help. Regards.

David Glasser

unread,
Oct 18, 2012, 3:15:23 PM10/18/12
to meteo...@googlegroups.com
Right, in general when you see a token whose name starts with
underscore (like _driver), that generally means it's an internal
implementation detail that may change at any time. And in fact, Meteor
0.5.0 did change things so that _driver isn't stored on the collection
anymore.

There's no officially supported way to call ensureIndex in Meteor
right now... but since you're already willing to use unofficial ways
that might break in future versions, I'll point out that 0.5.0 does
add an internal "_ensureIndex" method on Collections...
> --
> You received this message because you are subscribed to the Google Groups
> "meteor-talk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/meteor-talk/-/j2DzWQ7N1g8J.
> To post to this group, send email to meteo...@googlegroups.com.
> To unsubscribe from this group, send email to
> meteor-talk...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/meteor-talk?hl=en.

Jean-guillaume Lalanne

unread,
Oct 20, 2012, 7:23:12 AM10/20/12
to meteo...@googlegroups.com
Hi David,

I did thank you on irc but i am not sure you got my message.
So thank you again. It works well with the _ensureIndex method.

Regards,
Jean-guillaume


Envoyé de mon iPad
Reply all
Reply to author
Forward
0 new messages