home shape

ArangoDB Easter Egg Hunt: Join the Fun and Discover Surprises!

While working hard on the next release and hacking away new interesting things to include into our favourite database, we decided to take a short break to have some fun just in time for Easter. All teams gathered together to do some Easter eggs coloring, chocolate-eating and fun-having 🙂

We’ve colored a lot of eggs in our favourite colors – green and brown, and hid them all around our office and beyond. Now, here is a little challenge for you to help us find them.

Download the dataset -> `arangodb-easter-dump.zip` and unzip it. Then use arangorestore to load the dataset into your ArangoDB instance. This is normally done by running the following command from a command-prompt:

arangorestore path-to-unzipped-data --create-database --server.database arangodb-easter-dump

Then open the query page in WebUI and let’s start playing!

For our egg hunt we want to search our dataset for specific eggs that were hidden by the members of our marketing team. To make it slightly more challenging we only search for those eggs that are colored in at least one of the primary colors of our logo. Also the eggs we are looking for were hidden after the 3.3 release of ArangoDB, because no one likes old eggs. At the end we want to order them by the distance to ArangoDB office in Cologne, Germany.

All you need is the following query and some knowledge to fill the gaps.


FOR team IN teams
  FILTER team.name == "marketing"
  FOR employee IN INBOUND team._id worksIn
    SORT employee.name
    RETURN CONCAT((
      FOR egg, hiding IN OUTBOUND employee._id hasHidden
        FILTER hiding.time >= DATE_TIMESTAMP(@release)
        FILTER egg.colors ANY IN @colors
        SORT DISTANCE(@office.lat, @office.lon, egg.location[0], egg.location[1])
        RETURN egg.label)[*])

As you can see, the query uses bind parameters, which you have to fill in. You have to find out the following bind parameters: 3.3 release date (format yyyy-mm-hh); logo primary colors (format e.g. purple); cologne office location (latitude and longitude);

On the right side of the screen in the query editor, you have to set the bind parameters view to JSON, copy the following into it, and change the values in between “” to the correct parameters that you found out!


{
  "release": "",
  "colors": ["", ""],
  "office": {
    "lat": 0,
    "lon": 0
  }
}

Let us know what you found – tweet a screenshot of your results using #ArangoDB #database and wish us a Happy Easter, too!

We wish you a lovely weekend and have fun!

Julie Ferrario

2 Comments

  1. Olivier BONNAURE on March 29, 2018 at 6:26 pm

    Please fix command line 😉
    `arangorestore path-to-unzipped-data –create-database –server.database arangodb-easter-dump`

    • ArangoDB database on April 11, 2018 at 12:12 pm

      Hey Olivier, thanks a lot for spotting. It has been fixed 🙂

Leave a Comment





Get the latest tutorials, blog posts and news: