简体   繁体   中英

How do I write expressions for Birt with Mongo?

I've found the documentation page http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.birt.doc%2Fbirt%2Fds-HowToSpecifyWhatDataToRetrieveDataFromMongoDBDataSource.html which says I can write a Run Database Command expression and The default command type is FindQuery . How do I write a FindQuery expression.

Choose the "$query Expression" button in Edit Data Set window. Then type in the find query that you want... for example if you loaded the MongoDB sample database from http://docs.mongodb.org/manual/tutorial/aggregation-zip-code-data-set/

You can do a find query such as:

{ pop: { $gte: 15000  } }

This searches for all records that have a population greater than or equal to 15000 people. You could also run some of the following find queries:

{ state: { $in: ["WA", "OR" ] } } //finds all of the cities in WA and OR

{$and: [{ state:"WA" },{ pop: { $gte: 50000 } }]} //finds all of the cities in WA with a population greater than 50,000-

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM