-
Install a random data generator package
To generate large volumes of synthetic data for development and testing, install a random data generator on the command line. In this example we use Falso.
$ npm install @ngneat/falso
-
Connect to the MongoDB Shell
The MongoDB Shell is an interactive JavaScript interface to MongoDB. You can use the MongoDB Shell to quickly and easily create, query, and update data.
-
Run this script in the shell to generate your data
This script creates a dataset with 1,000 documents following the document pattern provided:
const falso = require('@ngneat/falso');
const data = [];
for (let i = 0; i < 1000; i++) {
data.push({
plot: falso.randParagraph(),
runtime: falso.randNumber({min:0,max: 200}),
title: falso.randMovie(),
lastupdated: falso.randPastDate(),
num_theaters: falso.randNumber({min:0,max: 1000}),
total_revenue: falso.randNumber({min:0,max: 10000}),
viewers: falso.randNumber({min:0,max: 10000}),
num_mflix_comments: falso.randNumber({min:0,max: 50})
});
}
use('movie_app');
db.movies.insertMany(data);Edit the JSON document to modify the data you generate.
Change movie_app and movies to customize the name of your dataset.
Support Center
Find answers to commonly asked questions about insurance policies, claims, bills and more
Search
<% if (previousArticle) { %>
<% } %>
<% if (items.length > 1) { %>
<% if (previousTitle) { %>
<% } %>
<% if (nextArticle) { %>
<%= previousTitle %>
<% } %> <%= previousArticle.title %>
<% if (nextTitle) { %>
<% } %>
<%= nextTitle %>
<% } %> <%= nextArticle.title %>In this article
-
<% items.forEach(function(item) { %>
- <%= item.name %> <%= partial('partial-table-of-contents', { items: item.children, partial: partial }) %> <% }); %>
-
<% items.forEach(function(item) { %>
- <%= item.name %> <%= partial('partial-table-of-contents', { items: item.children, partial: partial }) %> <% }); %>
Comments
0 comments
Please sign in to leave a comment.