Searching cells

Searching cells in the BeeYard App

  1. Start by clicking on the Add query button.

    Add query
    Figure 1. Add query
  2. The query dialog opens and you can then chose from the various options how to create a query: Simple, Builder, Advanced and Id colletion.

    You’d use the Simple dialog to easily query by Tags or various cell Timestamps.

    You’d use the Builder dialog to setup more complicated chain of and/or prepared queries such as Cell ID.

    The ID collection dialog is useful if you have a list of cell IDs you’d like to search by.

    Finally, the Advanced dialog enables you to leverage the full power of the Mongo query language to search cells. Use the Help button to see the structure of the cell document in the database. The easiest way to start with the advanced queries is to click the Translate button from all the other dialogs to get your query translated into the Mongo query syntax.

  3. Finally, click the Apply button to execute your query. The query appears as a "bubble", so that you can easily modify it later or continue with another query that will be chained with the previous one in AND manner. You can also save your query as a favorite query in the current workspace to make it accesible to others.

Advanced query examples

  • Empty filter matching all cells:

    {}
  • Get a cell by its ID:

    {
        "_id": { "$eq": UUID('d90387d4-6200-47c4-ac34-7404541fba1a')}
    }
  • Get cells containing an exact tag:

    {
        "tags": {
            "$in": [{"category": "system.cell_type", "name": "data"}]
        }
    }
  • Get cells that have a tag with name "tag1" or "tag2":

    {
        "tags.name": {
            "$in": ["tag1", "tag2"]
        }
    }
  • Get cells that have a tag with name "tag1" and "tag2":

    {
        "tags.name": {
            "$all": ["tag1", "tag2"]
        }
    }
  • Get cells that were created between 1.1.2000 10:35:00 and 1.1.2000 23:20:19:

    {
        "$and": [{
            "created":{
                "$gte": ISODate("2000-01-01T10:35:00.000Z")
            }
        },{
            "created":{
                "$lte": ISODate("2000-01-01T23:20:19.000Z")
            }
        }]
    }
  • Get cells that contain searchable document that contains property "code" with value "0001":

    {
        "files.content.code": {
            "$eq": "0001"
        }
    }

    The document would like the following:

    { "code": "0001" }
  • Get cells with at least one image:

    { "files.dataType": { "$eq": "image" }}
  • Get cells that have a description ending with the letter "b":

    { "description": /b$/ }
  • Get cells that have a property whose key starts with the letter "a":

    {
       "properties.key": /^a/
    }
  • Get cells uploaded within last hour:

    {
        "$expr": {
            "$gt": [
                "$uploaded",
                {
                    "$dateSubtract": {
                        "startDate": new Date(),
                        "unit": "hour",
                        "amount": 1
                    }
                }
            ]
        }
    }