Application Development (web) – PlayList
Realm Creating Sophisticated GraphQL APIs in Minutes
The MERN Stack Evolved Express to MongoDB Realm (Todo HTTP React)
https://github.com/wbleonard/mern-stack-part-04
https://github.com/wbleonard?tab=repositories (Repository List)
MongoDB-Realm(Stitch)
1.Managing 2.Monitoring 3.Scaling MongoDB Realm is a set of whole Bunch of Features : Users & Authentication MongoDB Data Access Sync GraphQL API Functions Triggers Services Static Hosting Values & Secrets Application Management
The serverless platform from MongoDB
Functions : Run your Javascript code server-side, within the Realm serverless backend. Realm transparently scales to meet your usage
Triggers : Executes functions according to a schedule, or in real time in response to changes in the database or user authentication events.
Rules : Declratively control which fileds a user can access by defining simple JSON rules or Javascript functions
Services : Third-party services, such as Twilio can easily be referenced in the client.
Static Hosting : Run your entire web application on MongoDBRealm and MongoDB Atlas
Example : 1
const userAction = async () => {
let cust = await document.getElementById('myInput').value;
let txt = "";
let account_txt = "";
let img = "https://www.clipartkey.com/mpngs/m/96-966685_contact-person-icon-png.png"
console.log(cust);
const resp = await axios({
url: 'https://realm.mongodb.com/api/client/v2.0/app/bankingdongs-jbwjq/graphql',
method: 'post',
headers: {
'Authorization': `Bearer ${user.auth.activeUserAuthInfo.accessToken}`
},
data: {
query: `
query {
customer (query: {name: "${cust}"}){
name
email
address
accounts {
account_id
products
}
}
}
`
}
})
console.log(resp);
// IF Dog Quote is hit
if(resp.data.data.DogAndQuote){
txt = `${resp.data.data.DogAndQuote.quote} <br> - ${resp.data.data.DogAndQuote.author}`;
img = resp.data.data.DogAndQuote.dogImage;
showElement("quote")
}
}
<form method="POST" onsubmit="userAction()" action="javascript:">
<input type="text" onsubmit="userAction()" autocomplete="off" id="myInput" class="form-control" placeholder="customer name..." style="font-size: 2em; order:none">
</form>
Documentations :
Apollo Client (React) — MongoDB Realm
Load Sample Data into Your Atlas Cluster — MongoDB Atlas
MongoDB Realm – GraphQL (React/Apollo) – CodeSandbox
mongodb-university/realm-graphql-apollo-react
MongoDB Realm SDKs And Node.js SDK
GraphQL Types, Resolvers, and Operators
Realm Creating Sophisticated GraphQL APIs in Minutes
GraphQL: The Easy Way to Do the Hard Stuff
Serverless API & Mongod
MongoDB Realm Hosting: React Tutorial
https://www.youtube.com/watch?v=OUlTkI-ERsk
Using MongoDB as a Realtime Database with Socket.IO and Change Streams
Building a Serverless App with MongoDB Atlas, Realm and AWS
Functions + Triggers Demo – MongoDB Realm
exports = async function() {
//Computer joke api from strom consultancy : http://quotes.stormconsultancy.co.uk/api
const jokeUrl = "http://quotes.sotrmconsultancy.co.uk/random.json";
const jokeResponse = await context.http.get({url: jokeUrl})
const jokePayload = EJSON.parse(jokeResponse.body.text());
const quote = jokePayload.quote;
const author = jokePayload.author;
const dogUrl = "https://dog.ceo/api/breeds/image/random"
const dogResponse = awiat context.http.get({url: dogUrl});
const dogPayload = EJSON.parse(dogResponse.body.text());
const dogImage = dogPayload.message;
return {
quote: quote,
author: author,
dogImage: dogImage
}
}
Handling images (and other big files) in MongoDB Realm: bandwidth limit?
https://developer.mongodb.com/community/forums/t/handling-images-and-other-big-files-in-mongodb-realm-bandwidth-limit/7767
Introducing GraphQL Support in MongoDB Atlas with Stitch
https://developer.mongodb.com/how-to/graphql-support-atlas-stitch
Enforce a Document Schema – Nested Structure creation
https://docs.mongodb.com/realm/mongodb/enforce-a-document-schema/#generate-a-schema
Document Schemas
https://docs.mongodb.com/realm/mongodb/document-schemas/
GraphQL API – https://docs.mongodb.com/realm/graphql/
GraphQL API – Expose Data in a Collection
https://docs.mongodb.com/realm/graphql/expose-data/
GraphQL API – Define a Custom Resolver
https://docs.mongodb.com/realm/graphql/custom-resolvers/
GraphQL Types, Resolvers, and Operators
https://docs.mongodb.com/realm/graphql/types-and-resolvers/#scalar-types
https://docs.mongodb.com/realm/sdk/ SDK
https://developer.mongodb.com/ (Developer Forum)
https://github.com/mongodb-university (realm repositories)
https://github.com/mongodb-university/realm-tutorial (realm-tutorial-web , realm-tutorial-react-native)
https://github.com/mongodb-university/realm-graphql-apollo-react (realm-graphql-apollo-react)
Create a Task Tracker App – https://docs.mongodb.com/realm/tutorial/
Set up the Task Tracker Tutorial Backend – https://docs.mongodb.com/realm/tutorial/realm-app/ (Tracker Backend repositories)
Task Tracker (Web) – https://docs.mongodb.com/realm/tutorial/web-graphql/ (Tracker FrontEnd repositories)
MongoDB Realm > Users & Authentication
Realm SDKs > MongoDB Realm Web SDK > MongoDB Realm
MongoDB Realm > GraphQL API – GraphQL Types, Resolvers, and Operators
Realm SDKs > MongoDB Realm Web SDK – Apollo Client (React)
mongodb-realm-graphql-reactapollo
Querying MongoDB in the Browser with React and Realm
https://developer.mongodb.com/how-to/querying-mongodb-browser-realm-react/
Git : https://github.com/mongodb-developer/realm-web-example
MongoDb Drivers :
https://docs.mongodb.com/drivers/
MongoDb Authentication – authentication mechanism
DEFAULT
SCRAM-SHA-256
SCRAM-SHA-1
MONGODB-CR
MONGODB-AWS
X.509
Enterprise Authentication Mechanisms –
Kerberos (GSSAPI/SSPI)
LDAP (PLAIN)
MongoDB Realm JWT Meta Data and Custom User Data
https://medium.com/swlh/mongodb-realm-jwt-meta-data-and-custom-user-data-dc04d86bf542
Example of Realm Database in React Native