Skip to content

Instantly share code, notes, and snippets.

@sofiageo
Created January 17, 2020 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sofiageo/ed3d8cf0b66555979a14082458fc5a96 to your computer and use it in GitHub Desktop.
Save sofiageo/ed3d8cf0b66555979a14082458fc5a96 to your computer and use it in GitHub Desktop.
RxDB array index
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