npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

signalk-to-mongodb-atlas

v1.0.1

Published

SignalK Plugin to send data to a MongoDB Atlas hosted database

Downloads

6

Readme

signalk-to-mongodb-atlas

SignalK plugin to push deltas to MongoDB Atlas (or any compatible HTTP endpoint)

The plugin is designed for batch writes to a cloud hosted MongoDB Atlas data base. It could also be used to push data to many other online services that provide a https:// endpoint with a simple API key for authentication.

Data Format

As MongoDB is a document based (noSQL) database, measurements are pushed as simple JSON objects as follows:

{
  "source": "NMEA2K.c0a0b40010e111f6",
  "context": "vessels.urn:mrn:imo:mmsi:100000001",
  "path": "environment.wind.speedApparent",
  "value": 0.56,
  "time": {		// eJSON time
    "$date": {
      "$numberLong": "1666287376565"
    }
  },
  "ver": "2",		// any user defined tags are added as properties
  "self": true,		// 'tag as self' flag
  "dt": 1666287376,	// unix date-time in seconds
  "mmsi": 100000001	// vessel mmsi derived from the signalK context
}

Config Parameters

API Endpoint

the full url to your cloud hosted MongoDB Atlas endpoint https://ap-southeast-2.aws.data.mongodb-api.com/app/[your endpoint]

API Key

the secret MongoDB Atlas API Key for your cloud hosted database some secret key

API Http Method

the HTTP method GET, PUT, POST

Batch Size

the number of values to send in a single batch to the MongoDB Atlas endpoint 100

Flush Interval

maximum time in seconds to keep points in an unflushed batch, 0 means don't periodically flush 60

Maximum Buffer Size

maximum size of the buffer (this is recommended as a multiple of Batch Size to allow for items that may not have been able not be sent the first time) 1000

Maximum Time to Live

maximum time to buffer data in seconds - older data is automatically removed from the buffer (i.e. and not sent) 180

Tag as 'self' if applicable

tag measurements as {self: true} when from vessel.self - requires an MMSI or UUID to be set in the Vessel Base Data on the Server->Settings page 180

Default Tags

default tags added to every measurement {name: 'my tag', value: 'true'}

Path Options

these options are set per individual path, selected to send data from SignalK to MongoDB Atlas

Enabled?

enable writes to MongoDB Atlas for this path (server restart is required) true

SignalK context

context to record e.g.'self' for own ship, or 'vessels.' for all vessels, or '' for everything self

SignalK path

path to record e.g.'navigation.position' for positions, or 'navigation.' for all navigation data, or '' for everything true

Recording interval

minimum milliseconds between data records 1000

Path tags

Define any tags to include for this path {name: 'my path', value: '1234'}