Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.

mongodb connector - criteria definition

d4emuellerd4emueller Member Posts: 4 Contributor I
edited November 2018 in Help
Hi,

is there a description, how to write critera for mongodb connector ?

I wrote this snippet for Robomongo. There works. What are the diffs to RapidMiner mongodb connector?

Thanks for help!


db['mycollection'].find(
    {
      time: {
            $gte: ISODate("2015-01-27T00:00:00.000Z"),
            $lt : ISODate("2015-01-28T00:00:00.000Z")                   
      },
      code: '200',
      path: {
            $regex: '/.*pdf*/'
      }
  },
  {
      path : 1,
      size : 1,
      _id : 0         
  }).limit (100)


Regards
Ines

Answers

  • MichaelKnopfMichaelKnopf Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 31 RM Data Scientist
    Hello Ines,

    The Read MongoDB operator allows to specify both a query criteria object and a projection object, as well as to limit the results.

    Thus, you should be able to reuse the JSON objects from your Robomongo query without further modifications.

    Relevant Read MongoDB parameters:

    mongodb instance: MyInstance
    collection: mycollection
    criteria:
    {
           time: {
                 $gte: ISODate("2015-01-27T00:00:00.000Z"),
                 $lt : ISODate("2015-01-28T00:00:00.000Z")                     
           },
           code: '200',
           path: {
                $regex: '/.*pdf*/'
           }
    }
    projection:
    {
           path : 1,
           size : 1,
           _id : 0         
    }
    limit: 100
    skip: 0

    Note that limit and skip are expert parameters that might be hidden by default.

    You might also check out this Getting Started Guide that shows how to setup your MongoDB connection.

    Best,
    Michael
Sign In or Register to comment.