Rogue 2 - 2d index

32 views
Skip to first unread message

alexmnyc

unread,
Apr 23, 2013, 1:23:30 PM4/23/13
to rogue...@googlegroups.com
It's hard to understand from the documentation whether or not these two lines in Venue model actually are supposed to create an index. Running code as is, I don't see index ever being created in Mongo.


    val geoIdx = Venue.index(_.geolatlng, TwoD)
    override val mongoIndexList = List(geoIdx)

If I call: 

 import net.liftweb.mongodb.BsonDSL._
 ensureIndex(geolatlng.name -> "2d", unique=false)

then i see index being created.

Is this the expected behaviour? If so, what is the purpose of mongoIndexList then?

Thank you.

alexmnyc

unread,
Apr 23, 2013, 1:24:47 PM4/23/13
to rogue...@googlegroups.com

Jason Liszka

unread,
Apr 23, 2013, 1:28:23 PM4/23/13
to rogue...@googlegroups.com
Correct, it doesn't create an index in mongo. You have to do that manually in the mongo shell, or through the driver as you have done.

That code just allows rogue to know what the indexes are so that it can warn (at runtime) if a query does not match an index.


On Tue, Apr 23, 2013 at 1:24 PM, alexmnyc <a.mik...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "rogue-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rogue-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

alexmnyc

unread,
Apr 23, 2013, 2:34:24 PM4/23/13
to rogue...@googlegroups.com
Thanks for clarification, Jason! Much appreciated.


Reply all
Reply to author
Forward
0 new messages