sszretter Posted August 17, 2011 Share Posted August 17, 2011 In iReports I have the mongodb connector installed and working, but I am having trouble getting an 'or' or 'and' query to work: This works to bring back ALL records: <queryString language="MongoDbQuery"> <![CDATA[{ 'collectionName':'Encounters' }]]> </queryString> But I have all kinds of variations to actually query a field for not equal to null / not blank (I want to find all records with a BSBegin not null and not blank:<queryString language="MongoDbQuery"> <![CDATA[{ 'collectionName':'Encounters' ,'findQuery':{ '$and': { 'bsBeginDT':{'$ne':null}, 'bsBeginDT':{'$ne':''} } } }]]> </queryString> I have tried several variations, with cury brackets around each query, square brackets around the $and criteria, etc. I either get iterator errors, report contains no pages or other errors. Link to comment Share on other sites More sharing options...
eddiaz Posted February 15, 2012 Share Posted February 15, 2012 $and and $or operators works with arrays rather than with maps as stated hereHere is your query modified { collectionName : 'Encounters', findQuery : { $and : [ { bsBeginDT : { $ne : null } }, { bsBeginDT : { $ne : '' } } ] }}MongoDbDataSource 0.12 is published now with new features like (as you may noticed) avoiding quotes for Map keysPlease let us know how this goes for youEricPost Edited by eddiaz at 02/15/2012 17:35 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now