Incorrect property name in "CreateCollectionOptions" for ArangoDB 3.7
Version: 7.0.0-rc.1
I'm not 100% sure if arangojs supports the upcoming release of ArangoDB 3.7, so please feel free to close this if so.
I was testing creating a collection programatically as described in the documentation:
const collection = database.collection(col.name);
const collectionExists = await collection.exists();
if (!collectionExists) {
await collection.create({
validation: {
rule: {
properties: { nums: { type: "array", items: { type: "number", maximum: 6 } } },
additionalProperties: { type: "string" },
required: ["nums"],
},
},
});
}
The create method executes successfully, however, when inspecting the collection via the web interface or retrieving the properties of it via the REST API, the schema is not present. This is due to the fact that the options for the create method are spread into the POST request for /_api/collection (https://github.com/arangodb/arangojs/blob/main/src/collection.ts#L3163), but the Swagger documentation lists the property name as schema rather than validation.
I've updated this and tested it locally, and it resolves the issue. I'm happy to raise a PR but I wanted to ensure that the library is supporting ArangoDB 3.7.
Looks like I was working off an earlier development version and the property may have been renamed.