Skip to main content

Mongo and redis cli

Project description

dbcli

dbcli provides lightweight utilities set for basic CRUD operations for MongoDB and Redis.

With mcli You can access mongo documents for create and edit operations using your favourite text editor. It validates document and performs add and update operations.

rcli provides similar interface for Redis DB. You are able to edit strings(bytes), lists and hashs with json-like syntax in your text editor.

$EDITOR is used for bash. For Windows OS notepad or other windows editor.

Downloads Downloads Downloads

DataBase cli utilities

  • mcli - Mongo client based on pymongo
  • rcli - Redis client based on pyredis

Installation

pip install dbcli-mongo-redis

mcli usage examples

mcli list-dbs
mcli list-cols -d books
mcli -d books -c authors list-docs
mcli -d books -c authors list-docs -f '{"Language":"Chinese"}'
mcli -d aws -c images show-doc -i ami-eede2314
mcli --database aws --collection images show-doc -i ami-eede2314
mcli --database aws --collection images show-doc --document-id ami-eede2314
mcli -d gcloud -c elements show-doc -o 5ef869cf316dd267c64be59c
mcli -d gcloud -c elements show-doc --document-object-id 5ef869cf316dd267c64be59c
mcli -d devops -c newcol edit-doc -o 5ef865fceb8e7562e8eaf9f6
mcli -d devops -c newcol edit-doc  -i object-234
mcli -d devops -c newcol del-doc -i object-234
mcli -d devops -c newcol del-doc -o 5ef865fceb8e7562e8eaf9f6

rcli usage examples

rcli db-count
rcli list-keys
rcli list-keys -p image
rcli show-db
rcli show-db -k image_325
rcli show-db -p image_
rcli add-data
rcli add-key
rcli add-key -t hash
rcli edit-doc -k image_325
rcli del-doc -k image_214
rcli to-set -k some_list
rcli to-zset -k some_hash

Inspired by dbcli.

Limitations

Should avoid using in production and for huge amount of data. Since it's interactive tool it shouldn't be used for automatic updates of multiple docs.

License & Authors

  • Authors: Rasul Osmanov, Artur Krasnykh
Copyright (c) 2020, Rasul Osmanov

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

TODO

- AWS DynamoDB client
- Google Cloud DataStore client

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbcli_mongo_redis-0.3.7.tar.gz (8.6 kB view hashes)

Uploaded Source

Built Distribution

dbcli_mongo_redis-0.3.7-py3-none-any.whl (8.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page