Using the kuzzle.collection.create('abc123', 'yellow-taxi', {definition});
to create a collection on an index. The collection gets created but the mappings arent applied.
Here is the code im using
const definition = {
mappings: {
dynamic: "true",
properties: {
VendorID: {
"type": "integer"
},
tpep_pickup_datetime: {
"type": "date"
},
........
}
},
settings: {
}
};
try {
// Creates a collection
await kuzzle.collection.create('abc123', 'yellow-taxi', {definition});
// await kuzzle.collection.create('abc123', 'yellow-taxi');
console.log('Collection');
} catch (error) {
console.error(error.message);
}
Here is the kuzzle documentation referance im using
https://docs.kuzzle.io/sdk/js/7/controllers/collection/create/#usage
After kuzzle.create - I run
const mapping = await kuzzle.collection.getMapping('abc123', 'yellow-taxi');
console.log('mapping: ', mapping);
mapping: { dynamic: 'false', properties: {} }