Gathering detailed insights and metrics for variety-cli
Gathering detailed insights and metrics for variety-cli
Gathering detailed insights and metrics for variety-cli
Gathering detailed insights and metrics for variety-cli
npm install variety-cli
52.4
Supply Chain
98.8
Quality
77.7
Maintenance
50
Vulnerability
99.6
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
77 Stars
67 Commits
16 Forks
6 Watching
3 Branches
6 Contributors
Updated on 04 May 2024
JavaScript (94.49%)
Dockerfile (5.51%)
Cumulative downloads
Total Downloads
Last day
400%
5
Compared to previous day
Last week
-43.8%
9
Compared to previous week
Last month
-66.7%
48
Compared to previous month
Last year
-33%
1,168
Compared to previous year
4
Command line interface for the Variety Schema Analyser.
You can install the Variety-cli globally in your system by calling:
npm install variety-cli -g
This will download the latest version from the NPM repository.
If you want to upgrade variety-cli to newest version, type the same command as for the installation: npm install variety-cli -g
.
You can also run variety-cli in Docker using a pre-built image in Docker Hub. In this case, you'll generally want to run Variety against an external MongoDB host with the --host
flag. See the example below for more information.
The variety-cli image is tagged in Docker Hub as objectrocket/variety, which you can run as follows:
docker run objectrocket/variety test/foo --host db.example.com --quiet
Any arguments after the image name are passed to variety-cli, just as if you were running it directly from the command-line.
First, build the image with docker build
:
docker build -t variety .
This will build a Docker image tagged locally as variety
, which you can run with:
docker run variety test/foo --host db.example.com --quiet
Basic usage without any options. Database and collection names are separated by the /
character:
variety database_name/collection_name [options]
Define your own query used to filter analysed documents:
variety test/users --query='{"bio":{"$exists":true}}'
The variety-cli uses HJSON to parse --query
and --sort
parameters and should be fault tolerant.
Nevertheless you should quote the JSON values properly. The quotes usage is little bit different for every operation system. Good description of JSON quoting can be found in the Amazon AWS documentation.
If you want to post-process the Variety results in another tool, maybe you find useful the JSON output. This command should produce valid JSON output:
variety test/users --outputFormat='json' --quiet
Print all available commands and options:
variety --help
The Variety-cli supports all the available parameters from the Mongo Shell. You can specify your --host, --port, --username, --password, --quiet and many other parameters. For all the available params of the mongo shell, see the Mongo documentation.
node variety-cli.js test/users --host localhost --port 27017 --quiet
$ variety test/users --host localhost --port 27017
MongoDB shell version: 3.0.0
connecting to: localhost:27017/test
Variety: A MongoDB Schema Analyzer
Version 1.4.1, released 14 Oct 2014
Using query of { }
Using limit of 5
Using maxDepth of 99
Using sort of { "_id" : -1 }
Using outputFormat of ascii
Using persistResults of false
Using collection of users
+------------------------------------------------------------+
| key | types | occurrences | percents |
| ------------------ | ------------ | ----------- | -------- |
| _id | ObjectId | 5 | 100.0 |
| name | String | 5 | 100.0 |
| bio | String | 3 | 60.0 |
| birthday | Date | 2 | 40.0 |
| pets | Array,String | 2 | 40.0 |
| someBinData | BinData-old | 1 | 20.0 |
| someWeirdLegacyKey | String | 1 | 20.0 |
+------------------------------------------------------------+
If you are behind some proxy, you should configure proxy setting in your environment (to allow variety-cli download of the variety lib).
Run this command (and change the proxy url to your needs):
npm config set https-proxy http://10.203.0.1:5187/
On the unix platforms this can be (temporary) achieved by calling:
export https_proxy=http://10.203.0.1:5187/
If you want to configure proxy for other node.js apps in the persistent way, add the command
to your .bashrc
or .bashprofile
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 7/17 approved changesets -- score normalized to 4
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More