Skip to content

Instantly share code, notes, and snippets.

@ayende

ayende/script.js Secret

Created December 11, 2023 16:23
Show Gist options
  • Save ayende/502133e9abcbe5efc21c8daa60cece6b to your computer and use it in GitHub Desktop.
Save ayende/502133e9abcbe5efc21c8daa60cece6b to your computer and use it in GitHub Desktop.
const readline = require('readline');
const Raven = require('ravendb');
const process = require('process');
const store = Raven.DocumentStore.create({
// ... initialize RavenDB client ...
}).initialize();
const session = store.openSession();
const doc = JSON.parse(readline.readline());
session.store(doc);
session.saveChanges()
.catch(error => {
console.error(error);
process.exit(1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment