New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mongoose-xray

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose-xray

AWS-Xray plugin for Mongoose

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
546
increased by0.74%
Maintainers
1
Weekly downloads
 
Created
Source

mongoose-xray

A Mongoose plugin to log requests and subsegments through AWSXray. This library requires Mongoose 5.x.

Setup

The plugin relies on AWS XRay automatic mode being in effect.

For more details on using XRay, see the docs

Usage

Simply register as a normal mongoose plugin.

Note that the plugin must be added before the model is created from the schema.


const xRayPlugin = require('mongoose-xray');
const gameSchema = new Schema({ ... });
gameSchema.plugin(xRayPlugin);

// Can also be registered as a global plugin
const mongoose = require('mongoose');
mongoose.plugin(require('mongoose-xray'));


If the options have the verbose flag turned on, more metadata will be added to XRay, potentially at the expense of performance. Verbose information is off by default for performance and security considerations.

const mongoose = require('mongoose');
mongoose.plugin(require('mongoose-xray'), { verbose:true });

Options

  • verbose Adds additional metadata based on the type of operation being conducted

Output

For all operations, XRay will record:

  • Model name + operation as an annotation
  • Model name as an annotation
  • Operation as metadata

With verbose:true, the following will be added:

Queries
  • filter - The filter applied to the query operation
  • update - The update if available
  • options - Query options
  • populatedPaths - Query paths populated
Documents
  • document - Stringified document
Aggregates
  • options - Aggregate options
  • aggregate - Stringified aggregate

FAQs

Package last updated on 02 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc