Table.bulkGet()
Syntax
db.table.bulkGet(keys)Parameters
Return Value
Remarks
Example
// Define DB
const db = new Dexie('foobardb');
db.version(1).stores({
friends: 'id'
});
async function test() {
// Add two friends:
await db.friends.bulkAdd([{
id: 1,
name: "Foo"
}, {
id: 2,
name: "Bar"
}]);
// Call bulkGet() to lookup values from given keys in the order of the requested array:
const [foo, nonExisting, bar] = await db.friends.bulkGet([1, 777, 2]);
console.assert (foo.name === "Foo");
console.assert (bar.name === "Bar");
console.assert (nonExisting === undefined);
}
test().then(()=>{
console.log("success");
}).catch(error => {
console.error(error);
});