Skip to content

graboskyc/MongoDBAtlas-SitchBlogWkshp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Background

Technical Complexity

Beginner to Intermediate

Software Required

  • Modern web browser such as Chrome
  • Optionally install MongoDB Compass but this is not required

Duration

45 Minutes

This is the github sample repo to go along with MongoDB Atlas Workshops. It will encompass a few different scenarios:

Scenarios

Deploying Atlas Clusters Workshop

Here follow the guide in DeployCluster.md.

Standard Stitch Blog Workshops

Your cluster must first be deployed so complete the section above.

In the standard Stitch workshops, we follow a Blog tutorial where we use MongoDB Atlas and MongoDB Stitch to allow QueryAnywhere to insert and view comments on a blog written entirely in front-end javascript.

See the Blog.md to follow along, or the blog post on MongoDB's website located here.

The blog-stitch-cli folder contains the export of code using the stitch-cli tool and is a good sample.

The HTML page generated by following the Blog.md Guide is the blog.html page.

Stitch Rekognition Workshop When Attendees Have AWS Accounts

Your cluster must first be deployed so complete the section above.

The goal of this workshop is to allow people to create Stitch Triggers that run on insert and call the AWS Rekognition API, which responds with data, then that data is used to update the document. The intent is a url attribute is provided in the document and Rekognition will run DetectLabels to annotate what it thinks it is a JPEG of.

In scenarios where we want to demonstrate using the built in AWS integration to the Rekognition service and each attendee has their own AWS account.

In this case, we follow along the guide Rekognition.md

Stitch Rekognition Workshop When Attendees Don't Have AWS Accounts

Your cluster must first be deployed so complete the section above.

The goal of this workshop is to allow people to create Stitch Triggers that run on insert and call an HTTP endpoint with a URL which responds with data, then that data is used to update the document. Here the REST endpoint acts as a proxy for AWS Rekognition.

In scenarios where we want to demonstrate using AWS Rekognition APIs but not everyone has access to their own AWS accounts and we do not want to distribute API keys, this is a good example.

The attendees would follow and build the StitchWebRequest.md guide step-by-step.

However you would first create a webhook following the example in Rekognition.md but instead of making a trigger, create the HTTP service that responds to a GET request, put a secret query param, and put contents of webhook.js into it, obviously adjusting for any changes in your naming. Then get the URL of the webhook to share with the weorkshop attendees.

In this example, they would query https://webhooks.mongodb-stitch.com/api/client/v2.0/app/wkshp-utilities-dwzzy/service/hook/incoming_webhook/detectLabels?secret=XXXX&uri=YYYY where XXXX is the secret and YYYY is the full URL to a JPEG image. It will then return

{
    "LabelModelVersion": "2.0",
    "Labels": [{
        "Confidence": { "$numberDouble": "99.27836608886719" },
        "Instances": [],
        "Name": "Monument",
        "Parents": []
    }, {
        "Confidence": {"$numberDouble": "98.91329956054688"},
        "Instances": [],
        "Name": "Statue",
        "Parents": [{ "Name": "Sculpture"}, {"Name": "Art"}]
    }, {
        "Confidence": {"$numberDouble": "98.91329956054688"},
        "Instances": [],
        "Name": "Art",
        "Parents": []
    }, {
        "Confidence": { "$numberDouble": "98.91329956054688"},
        "Instances": [],
        "Name": "Sculpture",
        "Parents": [{"Name": "Art"}]
    }, {
        "Confidence": { "$numberDouble": "72.21047973632812"},
        "Instances": [],
        "Name": "Human",
        "Parents": []
    }, {
        "Confidence": {"$numberDouble": "72.21047973632812"},
        "Instances": [{
            "BoundingBox": {
                "Height": {"$numberDouble": "0.344552606344223"},
                "Left": {"$numberDouble": "0.4248093068599701"},
                "Top": {"$numberDouble": "0.08544600009918213"},
                "Width": {"$numberDouble": "0.1412428766489029"}
            },
            "Confidence": {"$numberDouble": "72.21047973632812"}
        }],
        "Name": "Person",
        "Parents": []
    }]
}

when the URL was the Statue of Liberty.

Follow Along Workshop

If working at your own pace or you want to copy/paste the CRUD and agg queries, they are available here.