Set up the DB
Form.io's data model is driven by MongoDB. Deployments to Azure may use MongoDB Atlas or the Azure-native CosmosDB.
Last updated
Was this helpful?
Form.io's data model is driven by MongoDB. Deployments to Azure may use MongoDB Atlas or the Azure-native CosmosDB.
Last updated
Was this helpful?
Form.io requires a MongoDB-compatible database to run its platform. Refer to the process that matches the anticipate deployment stack:
MongoDB Atlas
Azure CosmosDB
Before deployment, create an account at . Follow the steps provided by MongoDB to create the cluster while observing the guidelines described below.
When configuring the performance of the cluster, it may be necessary to review the advanced settings. The particular settings selected may depend on the planned deployment. The following baseline standard may be used when determining the application's needs:
For production environments, the dedicated tier may be required.
Consider enabling multi-region replication to create additional instances for greater availability.
Choose a sufficient cluster tier based on the expected usage. M10 is typically sufficient for development. M20 is the recommended baseline for production.
When configuring the security settings in MongoDB Atlas after clicking Create Cluster, refer to the following guidelines:
Record the username and password for use in the connection string later.
Ensure the IP address of the Azure VM is added to the whitelist.
If the deployment requires additional security that would mandate a private endpoint, refer to the regarding connecting cloud services to a private endpoint.
From the MongoDB Atlas Project Overview, open the Connect Menu and generate a legacy (standard) connection string. It will appear similar to the following:
Note the following placeholders:
<node1>... : These will correspond to the individual instances of the DB.
<replicaSetName>: The atlas-generated replica set name.
<appName>: Typically formio.
Supplying the required info creates a connection string similar to the following, using the example password badPassword:
Observe that?ssl=true
indicates a database connection over SSL, &retryWrites=true
indicates retryWrites is supported, and uses the admin
database rather than IAM to authenticate.
Record this connection string for later.
Follow these instructions to setup a new database.
In the left-hand column, click on the menu item that says Azure Cosmos DB.
Click on the + Create button
When asked "Which API best suits your workload?" select Azure Cosmos DB for MongoDB
On the Basics enter these settings.
Under Project Details choose a Subscription
Under Project Details choose a Resource Group
Under Instance Details enter an Account Name.
Under Instance Details select a Region of you choice.
Under Instance Details select the Capacity Mode.
Under Instance Details uncheck Limit total account throughput.
You can then press Review + create button, you will then wait few moments for the database to create.
After the database has finished settings up on the left column you will select the Connection Strings tab.
Form.io does require that you use a standard connection string, so you will need to make a small change to what Azure provides you by adding your database name to the connection string.
This is placed right after the formio.documents.azure.com:10255/ and before the text ?ssl=true. It should look like the following.
This section will be dedicated to defining changes as they relate to Form.io between Cosmos DB versions. Currently Form.io supports the latest version of Cosmos DB (at the time of writing is 7.0).
In order to do a sort on a property, there must be an index set. This is different from how MongoDB works as MongoDB allows sorting on any property regardless of an index being set.
Cosmos DB supports basic $lookup
operations for equality matches but does not support advanced features like uncorrelated subqueries. For complex join operations, consider restructuring your data model or using alternative methods.
find
Query and Write Operation
Yes
Yes
Yes
Yes
Yes
insert
Query and Write Operation
Yes
Yes
Yes
Yes
Yes
update
Query and Write Operation
Yes
Yes
Yes
Yes
Yes
delete
Query and Write Operation
Yes
Yes
Yes
Yes
Yes
aggregate
Aggregation Command
Yes
Yes
Yes
Yes
Yes
count
Aggregation Command
Yes
Yes
Yes
Yes
Yes
addFields
Aggregation Stage
Yes
Yes
Yes
Yes
Yes
count
Aggregation Stage
Yes
Yes
Yes
Yes
Yes
group
Aggregation Stage
Yes
Yes
Yes
Yes
Yes
limit
Aggregation Stage
Yes
Yes
Yes
Yes
Yes
lookup
Aggregation Stage
Partial
Partial
Partial
Partial
Partial
match
Aggregation Stage
Yes
Yes
Yes
Yes
Yes
project
Aggregation Stage
Yes
Yes
Yes
Yes
Yes
skip
Aggregation Stage
Yes
Yes
Yes
Yes
Yes
sort
Aggregation Stage
Yes
Yes
Yes
Yes
Yes
unwind
Aggregation Stage
Yes
Yes
Yes
Yes
Yes
and
Boolean Expression
Yes
Yes
Yes
Yes
Yes
or
Boolean Expression
Yes
Yes
Yes
Yes
Yes
setIntersection
Set Expression
Yes
Yes
Yes
Yes
Yes
eq
Comparison Expression
Yes
Yes
Yes
Yes
Yes
gt
Comparison Expression
Yes
Yes
Yes
Yes
Yes
gte
Comparison Expression
Yes
Yes
Yes
Yes
Yes
lt
Comparison Expression
Yes
Yes
Yes
Yes
Yes
lte
Comparison Expression
Yes
Yes
Yes
Yes
Yes
ne
Comparison Expression
Yes
Yes
Yes
Yes
Yes
in
Comparison Expression
Yes
Yes
Yes
Yes
Yes
nin
Comparison Expression
Yes
Yes
Yes
Yes
Yes
concatArrays
Array Expression
Yes
Yes
Yes
Yes
Yes
filter
Array Expression
Yes
Yes
Yes
Yes
Yes
reduce
Array Expression
Yes
Yes
Yes
Yes
Yes
size
Array Expression
Yes
Yes
Yes
Yes
Yes
in
Array Expression
Yes
Yes
Yes
Yes
Yes
sum
Accumulator Expression
Yes
Yes
Yes
Yes
Yes
push
Accumulator Expression
Yes
Yes
Yes
Yes
Yes
addToSet
Accumulator Expression
Yes
Yes
Yes
Yes
Yes
String
Type
Yes
Yes
Yes
Yes
Yes
Object
Type
Yes
Yes
Yes
Yes
Yes
Array
Type
Yes
Yes
Yes
Yes
Yes
ObjectId
Type
Yes
Yes
Yes
Yes
Yes
Boolean
Type
Yes
Yes
Yes
Yes
Yes
and
Logical Operator
Yes
Yes
Yes
Yes
Yes
or
Logical Operator
Yes
Yes
Yes
Yes
Yes
exists
Element Operator
Yes
Yes
Yes
Yes
Yes
regex
Evaluation Query Operator
Yes
Yes
Yes
Yes
Yes
all
Array Operator
Yes
Yes
Yes
Yes
Yes
elemMatch
Array Operator
Yes
Yes
Yes
Yes
Yes
size
Array Operator
Yes
Yes
Yes
Yes
Yes
set
Update Operator
Yes
Yes
Yes
Yes
Yes
rename
Update Operator
Yes
Yes
Yes
Yes
Yes
unset
Update Operator
Yes
Yes
Yes
Yes
Yes
addToSet
Array Update Operator
Yes
Yes
Yes
Yes
Yes
pull
Array Update Operator
Yes
Yes
Yes
Yes
Yes
push
Array Update Operator
Yes
Yes
Yes
Yes
Yes
sort
Update Modifier
Yes
Yes
Yes
Yes
Yes
Single Field Index
Indexes
Yes
Yes
Yes
Yes
Yes
Compound Index
Indexes
Yes
Yes
Yes
Yes
Yes
Multikey Index
Indexes
Yes
Yes
Yes
Yes
Yes
Text Index
Indexes
No
No
No
No
No
2dsphere
Indexes
Yes
Yes
Yes
Yes
Yes
2d Index
Indexes
No
No
No
No
No
Hashed Index
Indexes
No
No
No
No
No
TTL
Index Properties
Yes
Yes
Yes
Yes
Yes
Unique
Index Properties
Yes
Yes
Yes
Yes
Yes
Partial
Index Properties
No
Only unique indexes
Only unique indexes
Only unique indexes
Only unique indexes
Case Insensitive
Index Properties
No
No
No
No
No
Sparse
Index Properties
No
No
No
No
No
Background
Index Properties
Yes
Yes
Yes
Yes
Yes
If you run into any issues as it relates version compatibility and is not defined below please consult the section of the Azure Documentation for .
If you an incompatibility is found, please provide details by contacting .
To resolve this, a can be added to the following collections:
The $lookup
aggregation does not yet support the feature that's introduced in server version 3.6. If you attempt to use the $lookup
operator with the let
and pipeline
fields, an error message that indicates that let
is not supported appears.
Refer to the for a complete list of Database Commands.