CLICommands

live-json

snug live-json <COMMAND>

Live JSON real-time database operations.

Subcommands

CommandWhat it does
subscribeSubscribe to a JSON document path for real-time updates
watchOpen a live-json WebSocket, subscribe to a path, and stream changes
unsubscribeUnsubscribe from a Live JSON subscription
subscriptionsList all active Live JSON subscriptions
statsGet Live JSON statistics
createCreate a new document with auto-generated ID
putCreate or update a document with specific ID
getGet a document by ID (metadata, content, or full)
fullGet the full document (metadata + content)
contentGet document content only
patchPatch document content using JSONPath
replaceReplace entire document content
metadataUpdate document metadata
deleteDelete a document
listList all documents
lockAcquire a lock on a document
unlockRelease a lock on a document

Run snug live-json <command> --help for that command's own options. The global options apply everywhere.

Examples

snug live-json subscribe -d user-settings -p '$.theme'
snug live-json subscribe -d user-settings -p '$.theme' -c ws_conn_123
snug live-json unsubscribe -s sub_123abc
snug live-json subscriptions --document user-settings --verbose
snug live-json stats
snug live-json create -c '{"key": "value"}' --name 'My Doc'
snug live-json put -d user-settings -c '{"theme": "dark"}'
snug live-json get -d user-settings
snug live-json get -d user-settings --view full
snug live-json full -d user-settings
snug live-json content -d user-settings
snug live-json patch -d user-settings -p '$.notifications' -v 'true'
snug live-json replace -d user-settings -c '{"new": "content"}'
snug live-json metadata -d user-settings --name 'Updated Name'
snug live-json delete -d user-settings
snug live-json list --limit 50 --search 'user'
snug live-json lock -d user-settings --duration 120
snug live-json unlock -d user-settings

Next

On this page