Exploring the integration of RxDB in my Angular project. I wanted to start with a simple example:
export const LANG = {
version: 0,
title: "Language Key",
type: "object",
properties: {
key: {
type: "string",
primary: true
}
},
required: ["key"]};
RxDB.create({
name: "test",
adapter: "idb",
multiInstance: false
}).then((db) => {
if (!db["language"]) {
db.collection({
name: "language",
schema: LANG
}).then((c) => {
c.upsert({key: "de-DE"}).then(() => {
console.log("inserted")
})
})
} else {
db["language"].findOne().exec().then((res) => {
console.log("found", res)
})
}
})
Encountering an issue where the created "language" collection is not found upon application reload. The code consistently follows the if-path instead of the expected else path.
Any insights on what might be going wrong here? Thanks for any assistance!