by, Chris Axxwell
MerlinDB the indexedDB API database based on MongoDB.'Alakazam'
This entire site is using MerlinDB, so, you can test it in the dashboard and interestingly check the element inspector in IndexedDB. Bring your mongoDB and mongoose techniques to indexedDB!
1 import MerlinDB, { Schema} from "@chrisaxxwell/merlin-db";2 //Or if you are using 'merlindb.max.js' just call 'new MerlinDB()'; 3 4 const merlin = new MerlinDB( ) ;5 merlin.connect( "MY-CATS-DATABASE") ; 6 7 const Cats = merlin.model( 'Cats-model', { 8 name: { type: String , required: true } , 9 breed: String 10 } ) ;11 12 Cats.insertOne( { name: "Alvin" } ) .then( data => { 13 console.log( data) ; 14 //Success 🔮 15 } ) ;16 17 Cats.find( { name: "Alvin" } ) .then( data => { 18 console.log( data) ; 19 //{ name: "alvin", breed: "Siamese" };🔮 20 } ) ;
MerlinDB is an IndexedDB-based database designed to store data locally in web browsers. Unlike conventional databases such as MongoDB, MerlinDB is optimized for web applications, offering an efficient and lightweight solution for storing data at browser runtime.