Get started with nedb CDN
MIT licensed
Nedb is a NoSQL database for Node.js, providing a simple key-value store interface.
Tags:- database
- datastore
- embedded
Stable version
Copied!
How to start using nedb CDN
const Nedb = require('nedb'); // Import Nedb
const db = new Nedb('database.db'); // Initialize a new database
db.loadDatabase(() => {
console.log('Database loaded');
// Define a sample data structure
const sampleData = {
name: 'John Doe',
age: 30,
city: 'New York'
};
// Insert the sample data into the database
db.insert(sampleData, (err, newDoc) => {
if (err) {
console.error('Error inserting document:', err);
} else {
console.log('New document inserted with ID:', newDoc._id);
// Find and print all documents in the database
db.find({}, (err, docs) => {
if (err) {
console.error('Error finding documents:', err);
} else {
console.log('All documents:', docs);
}
});
}
});
});
Copied!
Copied!
All versions
0.10.0
0.10.1
0.10.10
0.10.11
0.10.2
0.10.3
0.10.4
0.10.5
0.10.6
0.10.7
0.10.9
0.11.0
0.11.1
0.11.2
0.8.0
0.8.1
0.8.10
0.8.11
0.8.12
0.8.13
0.8.2
0.8.3
0.8.4
0.8.5
0.8.6
0.8.7
0.8.8
0.8.9
0.9.1
0.9.2
0.9.3
0.9.4
1.0.0
1.0.1
1.0.2
1.1.0
1.1.1
1.1.2
1.1.3
1.1.4
1.2.0
1.2.1
1.3.0
1.4.0
1.5.0
1.5.1
1.6.0
1.6.1
1.6.2
1.7.1
1.7.2
1.7.3
1.7.4
*** 1.8.0