?>

uProc + MongoDB Integrations

Appy Pie Connect allows you to automate multiple workflows between uProc and MongoDB

About uProc

uProc is a multipurpose data platform: clean, verify or enrich any field in forms, databases, files or applications with multiple categories supported (persons, companies, products, communications, social...).

About MongoDB

MongoDB is an open-source document-based database management tool that stores data in JSON-like formats. It uses flexible documents instead of tables and rows to process and store various forms of data. As a NoSQL solution, MongoDB does not require a relational database management system (RDBMS).

MongoDB Integrations
Connect uProc + MongoDB in easier way

It's easy to connect uProc + MongoDB without coding knowledge. Start creating your own business flow.

    Triggers
  • New Collection

    Triggers when you add a new collection.

  • New Database

    Triggers when you add a new database.

  • New Document

    Triggers when you add a new document to a collection.

  • New Field

    Triggers when you add a new field to a collection.

    Actions
  • Select Tool

    Select a tool to perform verification or enrichment

  • Create Document

    Create a new document in a collection of your choice.

How uProc & MongoDB Integrations Work

  1. Step 1: Choose uProc as a trigger app and Select "Trigger" from the Triggers List.

    (30 seconds)

  2. Step 2: Authenticate uProc with Appy Pie Connect.

    (10 seconds)

  3. Step 3: Select MongoDB as an action app.

    (30 seconds)

  4. Step 4: Pick desired action for the selected trigger.

    (10 seconds)

  5. Step 5: Authenticate MongoDB with Appy Pie Connect.

    (2 minutes)

  6. Your Connect is ready! It's time to start enjoying the benefits of workflow automation.

Integration of uProc and MongoDB

    uProc?

As mentioned in the previous chapter, uProc is a platform that supports MongoDB. It includes uProc-core and uProc-nodejs. uProc-core is an API used to manipulate MongoDB through binary protocp. uProc-nodejs is an extension of Node.js, which provides uProc-core API. uProc-core is written in C++ and it uses libbson for access to MongoDB. It is provided as a library named libmongoc. On the other hand, uProc-nodejs is an application programming interface (API. for Node.js. A web server for Node.js can be developed based on this API. If you are already familiar with Node.js, you can develop a web server by using uProc-nodejs without learning how to use MongoDB on your own. Since uProc-nodejs has many features that are not available in MongoDB itself, it will be beneficial to learn how to use it and develop web servers with it.

    MongoDB?

MongoDB is an open source document database, which is a type of NoSQL database. It is a good database when you are dealing with large vpumes of data and when you need fast responses to queries. Since each document in MongoDB is stored as a BSON (Binary JSON. value, data in MongoDB can be accessed very quickly because the data does not need to be parsed.

    Integration of uProc and MongoDB

Integration of these two tops makes it easy to develop web servers that take advantage of the flexibility of MongoDB while using all of the tops provided by uProc-nodejs to make development easier. You can develop your own web servers based on uProc-nodejs or use the ones provided by the uProc project. There are many useful web servers provided by the uProc project, such as:

uHTTPd. a simple web server that supports HTTP only

uWSGI. a WSGI-compliant web server for Python apps

uWSGI Python Server. a WSGI-compliant Python app server based on uWSGI

uSCGI. a simple SCGI (Simple Common Gateway Interface. web server for Python apps

uWSGI SCGI Server. a WSGI-compliant SCGI app server based on uWSGI

uFastcgi. a FastCGI (FCGI. web server for Python apps

uFastcgi Python Server. a FastCGI app server based on uFastcgi

Since this book focuses on developing web applications on Google App Engine, we will only introduce how to use uHTTPd in this chapter. We will show how to develop a simple Hello World application and deploy it to Google App Engine with the help of uHTTPd. First, let’s look at the source code of “Hello World” application written in Python and developed with Flask, a microframework for Python web applications. The source code is shown in Listing 13-3.

Listing 13-3. “Hello World” Application Source Code Written in Python and Developed with Flask (helloworldapp_v0.py)

from flask import Flask, render_template

import datetime

app = Flask(__name__)

@app.route('/time', methods=['GET'])

def get_current_time():

if datetime.datetime.now(.hour < 10:

return 'Good Morning'

if datetime.datetime.now(.hour < 20:

return 'Good Afternoon'

if datetime.datetime.now(.hour < 18:

return 'Good Evening'

return 'Good Night'

@app.route('/', methods=['GET'])

def index():

return render_template('index.html', current_time=get_current_time(), title='Hello World')

if __name__ == "__main__":

app.run(host='0.0.0.0', port=80)

In Listing 13-3, the “Hello World” application consists of two routes. /time and / (see line 5. When the user visits the site, he or she will see the time printed in the index page (see line 6. If the user goes to /time, he or she will see the current time printed in the index page (see line 7. This application is deployed to Google App Engine in Listing 13-4 by using uHTTPd, which we will explain later in this section.

Listing 13-4. Deployment Script of Hello World Application Using uHTTPd (helloworldapp_v0_gae_deployment_script_uhttpd_gae_version)

#!/usr/bin/env python

import httplib2

import os

import sys

import traceback

import httplib

import base64

import string

import argparse

from apiclient import discovery

from oauth2client import client as oauth2client_client

from googleapiclient import errors

from googleapiclient import errors as google_errors

from httplib import InvalidURL, UnsupportedScheme, Timeout,

MissingSchema, InvalidHeader, InvalidCharacter,

RequestEntityTooLarge,

ResponseNotReady, UnknownTransferEncoding,

UnimplementedFileMode

class BaseAuthPlugin(object). # https://developers.google.com/identity/sign-in/web/authentication#client_library_implementation

def __init__(self). # Google Client ID and Secret are obtained from # https://code.google.com/apis/conspe/#project:project_number # For example, https://code.google.com/apis/conspe/#project:project_number # GOOGLE CLIENT ID AND GOOGLE CLIENT SECRET ARE REQUIRED TO USE THIS PLUGIN # https://developers.google.com/identity/sign-in/web/authentication#auth-client-id # https://developers.google.com/identity/sign-in/web/authentication#auth-client-secret # http://stackoverflow.com/questions/13053292/googleappenginehttplib2httplib2connectionpopexception-pop-entry-already-invalid # https://groups.google.com/forum/#!topic/googleappengine/XkSVxBpZApQ # https://groups.google.com/forum/#!msg/google-appengineEktX9RwUHs/jO3h5wLQVrkJ # http://codeandlife.com/2014/01/23/google-appengine-python-urlfetch/#comment-5692 # https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/_samples/iotanalytics/appengine/README # https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/_samples/iotanalytics/appengine/main_test_app_service_configuration_for_blobstore_uploader#L15 # https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/_samples/iotanalytics/appengine/_main_init_uhttpd_conf_sample#L41 # http://stackoverflow.com/questions/11606369/googleappenginehttplib2httplib2connectionpopexception Uncaught exception in thread started by _HttpRequestHandler at /home/.appengine_tmp/.turbogears._http._HttpRequestHandler1aJy4o at /home/.appengine_tmp/.turbogears._http._HttpRequestHandler1aJy4o(<bound method _HttpRequestHandler1aJy4o at 0x7f02ebb5ce50>, (). at <bound method _requestHandler at 0x7f02ebb5

The process to integrate uProc and MongoDB may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.