Created
January 17, 2020 23:38
-
-
Save sofiageo/ed3d8cf0b66555979a14082458fc5a96 to your computer and use it in GitHub Desktop.
RxDB array index
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('#1859 Indexes do not work in arrays', async () => { | |
const mySchema = { | |
version: 0, | |
id: 'post', | |
type: 'object', | |
properties: { | |
documents: { | |
type: 'array', | |
items: { | |
type: 'object', | |
properties: { | |
title: {type: 'string', index: true} | |
} | |
} | |
} | |
}, | |
}; | |
// create a database | |
const db = await RxDB.create({ | |
name: util.randomCouchString(10), | |
adapter: 'memory' | |
}); | |
const collection = await db.collection({ | |
name: 'test', | |
schema: mySchema | |
}); | |
await collection.insert({ | |
documents: { | |
title: 'Title', | |
} | |
}); | |
db.destroy(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment