-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Manipulating the database
quenenni edited this page Apr 1, 2013
·
2 revisions
var db = require('ep_etherpad-lite/node/db/DB').db
db.get("record_key", function(err, record_value){
// do something
});
// Replace data value if the record already exists or create a new record with this key
db.set("record_key", data);
// Add a subvalue to an existing record data
db.setSub("record_key", ["sub_key"], value);
{"colorId":"#79d9d9","name":"tutti","timestamp":1364832712430,"padIDs":{"mypad":1}}
db.setSub("record_key", ["email"], "[email protected]");
{"colorId":"#79d9d9","name":"tutti","timestamp":1364832712430,"padIDs":{"mypad":1},"email":"[email protected]"}
By default, the results from a db.get are cached (set initially to 1000).
In some case, it's not what you want.
To remove the caching system for requests, you can set the 'caching' option to 0
db['dbSettings'].cache = 0;
- Docs
- Translating
- HTTP API
- Plugin framework (API hooks)
- Plugins (available)
- Plugins (list)
- Plugins (wishlist)
- Etherpad URIs / URLs to specific resources IE export
- Etherpad Full data export
- Introduction to the source
- Release Procedure
- Etherpad Developer guidelines
- Project to-do list
- Changeset Library documentation
- Alternative Etherpad-Clients
- Contribution guidelines
- Installing Etherpad
- Deploying Etherpad as a service
- Deploying Etherpad on CloudFoundry
- Deploying Etherpad on Heroku
- Running Etherpad on Phusion Passenger
- Putting Etherpad behind a reverse Proxy (HTTPS/SSL)
- How to setup Etherpad on Ubuntu 12.04 using Ansible
- Migrating from old Etherpad to Etherpad
- Using Etherpad with MySQL
- Customizing the Etherpad web interface
- Enable import/export functionality with AbiWord
- Getting a list of all pads
- Providing encrypted web access to Etherpad using SSL certificates
- Optimizing Etherpad performance including faster page loads
- Getting to know the tools and scripts in the Etherpad /bin/ folder
- Embedding a pad using the jQuery plugin
- Using Embed Parameters
- Integrating Etherpad in a third party app (Drupal, MediaWiki, WordPress, Atlassian, PmWiki)
- HTTP API client libraries