coronium.user.getUsers( ) -- search nested tables?

26 views
Skip to first unread message

Kevin Hincker

unread,
Jan 30, 2016, 10:23:20 AM1/30/16
to Coronium IO
I have user data that looks like this:

impressions: [ null, { expand: "y", invite: true,
}
],

When I use the dot syntax in the query fields of coronium.user.getUsers( ) like this:

coronium.user.getUsers( {impressions.expand="y"} ) I get a syntax error on the server. Mongo documents indicate that this would be the correct syntax for the search. Anyone have any thoughts? 

Thanks,
Kevin

Kevin Hincker

unread,
Feb 2, 2016, 2:56:57 PM2/2/16
to Coronium IO
UPDATE: Chris provided this code snippet, which does the trick - 

local answer = coronium.user.getUsers(
    {
        impressions = 
        { 
            ["$elemMatch"] = { expand = "y" } 
        }
    }
)

develephant

unread,
Feb 3, 2016, 9:40:35 PM2/3/16
to Coronium IO
Thanks Kevin!
Reply all
Reply to author
Forward
0 new messages