Possible to search by prefix, but reversed…?

9 views
Skip to first unread message

Viktor Hedefalk

unread,
Mar 7, 2013, 9:50:40 AM3/7/13
to rogue...@googlegroups.com
I have a use case where I need to find records for which a field is
the prefix of my search term. Is this possible?

To be concrete in code I would like to do the opposite of:

LogEntry.where(_.searchString startsWith ourSearchParam)

something like:

LogEntry.where(ourSearchParam startsWith _.searchString)

or

LogEntry.where(_.searchString isPrefixOf ourSearchParam)


Thanks,

Viktor

Jason Liszka

unread,
Mar 7, 2013, 10:53:54 AM3/7/13
to rogue...@googlegroups.com
I don't believe mongodb supports an operation like that.



--
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.



Viktor Hedefalk

unread,
Mar 8, 2013, 9:05:21 AM3/8/13
to rogue...@googlegroups.com
Yeah, I figured. I found an in-jvm solution that's good enough. Thanks,
Viktor
Reply all
Reply to author
Forward
0 new messages