NodeJS CLI to hide data in MongoDB. Can handle nested sub-documents fields and arrays. Internally uses faker.js to generate fake data.
npx mongohide \
--fields="name, phone" \
--uri="mongodb://localhost:27017" \
--db="test"
npx mongohide \
--fields="name, phone" \
--uri="mongodb://localhost:27017" \
--db="test" \
--includeCollections="orders, customers" \
--excludeCollections="products"
npx mongohide \
--fields="name, phone" \
--uri="mongodb://localhost:27017" \
--db="test" \
--locale="pt"
npx mongohide \
--fields="number:string.numeric, name" \
--uri="mongodb://localhost:27017" \
--db="test" \
Don't need to specify the field type, they will be inferred from the field name (default is lorem.word
). If you want to specify the type, use the format field:type
. See faker.js for available types.
Contributions are welcome! Please open an issue or submit a pull request.