Currently settings of Collections are immutable after createCollection has created them.
But we need to be able to change some aspects, starting with ability to enable support for "lexical" (addition of column "$lexical" with analyzed text index).
For enabling lexical, no re-indexing occurs: it just allows use of $lexical field (via matching column) and indexing of newly inserted or updated Documents.
Command should be CollectionCommand to connect at same URL path as AlterTable, linked from CollectionResource, and take Collection Name as Path parameter.
Command should initially accept an Object argument with single entry -- "lexical" -- accepting same value type as createCollections "options.lexical" field. So:
{
"alterCollection": {
"lexical": { "enabled": true, "analyzer": "standard" }
}
}
Q? Should this instead look more like "alterTable"? So:
{
"alterCollection": {
"operation": {
"enableLexical": { "analyzer": "standard" }
}
}
}
For now, go with Option 1.
Only {"enabled": true} case is to be supported in the first phase.
Return value should be simple "ok":
Command should:
- Fail if unrecognized root-level fields encountered (only "lexical" recognized)
- Fail if "lexical" was to be disabled
- Fail if "lexical" feature not enabled for the Database (same as for "CreateCollectionCommand")
- Succeed without action if "lexical" feature already enabled for Collection with same settings; fail if settings differ
- Try to:
- create "$lexical" column, create text-analyzed index for it (same as with "CreateCollectionCommand"), update "comment" of underlying Table
- Succeed if all above steps succeeded; fail otherwise
Note that this command does not have counterpart in MongoDB.
Currently settings of Collections are immutable after
createCollectionhas created them.But we need to be able to change some aspects, starting with ability to enable support for "lexical" (addition of column "$lexical" with analyzed text index).
For enabling lexical, no re-indexing occurs: it just allows use of
$lexicalfield (via matching column) and indexing of newly inserted or updated Documents.Command should be
CollectionCommandto connect at same URL path asAlterTable, linked fromCollectionResource, and take Collection Name as Path parameter.Command should initially accept an Object argument with single entry -- "lexical" -- accepting same value type as
createCollections "options.lexical" field. So:Q? Should this instead look more like "alterTable"? So:
For now, go with Option 1.
Only
{"enabled": true}case is to be supported in the first phase.Return value should be simple "ok":
Command should:
Note that this command does not have counterpart in MongoDB.