Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

CAST supports MongoDB via its Node.js extension. Details about how this support is provided for Node.js source code is discussed below.

Objects

The following specific objects are displayed in CAST Enlighten:

Node.js MongoDB connection

Node.js MongoDB collection

Code sample

This declaration will create a MongoDB connection and model object

Connector "Mongoose"
var mongoose = require('mongoose');
 
mongoose.connect('mongodb://localhost/analyzerlauncher', function(err) {
   if (err) { throw err; }
});

// create a Mongoose model
userModel = mongoose.model('users', userSchema);

What results can you expect?

Once the analysis/snapshot generation has completed, you can view the results in the normal manner (for example via CAST Enlighten):

Node.js application with MongoDB data storage exposing web services.

  • No labels