https://github.com/anicolaspp/maprdb-cleaner
A small tool to clean MapR-DB based on queries
https://github.com/anicolaspp/maprdb-cleaner
datab java mapr mapr-db scala tools
Last synced: 8 months ago
JSON representation
A small tool to clean MapR-DB based on queries
- Host: GitHub
- URL: https://github.com/anicolaspp/maprdb-cleaner
- Owner: anicolaspp
- License: mit
- Created: 2018-12-08T13:14:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-09-29T15:42:49.000Z (over 5 years ago)
- Last Synced: 2025-03-27T20:40:43.377Z (about 1 year ago)
- Topics: datab, java, mapr, mapr-db, scala, tools
- Language: Scala
- Size: 19.8 MB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# maprdb-cleaner
A small tool to clean MapR-DB based on queries
### Installation
```bash
brew install https://raw.githubusercontent.com/anicolaspp/maprdb-cleaner/master/maprdb-cleaner.rb
```
`maprdbcls` requires `java 1.8+`.
### Usage
- Deletes document with `_id` equals to `-1016518206699135554`.
```bash
maprdbcls -t /user/mapr/tables/rnd -q '{"$where": {"$eq": {"_id": "-1016518206699135554"}}}'
```
- Deletes all documents.
```bash
maprdbcls -t /user/mapr/tables/rnd --all
```
- Deletes all documents using id `custom_id_field`.
```bash
maprdbcls -t /user/mapr/tables/rnd --all --id custom_id_field
```
- Delete first 20 users which `age` is less than `10`.
```bash
maprdbcls -t /user/mapr/tables/users --query '{"$where": {"$lt": {"age": 10}}, "$limit": 20}'
```
`maprdbcls` executes `maprdbcls-1.0.0.jar` passsing the class path `/opt/mapr/lib/*`, so `MapR` client should
be installed in this path (defaults).