add explicit clear rejection of
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -231,6 +231,12 @@ describe.each(databases.eachSupportedId())(
|
||||
).resolves.toEqual(['service-a', 'website-c']);
|
||||
});
|
||||
|
||||
it('throws on $contains operator', async () => {
|
||||
await expect(
|
||||
query({ 'metadata.name': { $contains: 'service' } as any }),
|
||||
).rejects.toThrow(/\$contains operator is not supported/);
|
||||
});
|
||||
|
||||
it('throws on top-level primitive', async () => {
|
||||
await expect(query('bad-value' as any)).rejects.toThrow(
|
||||
/top-level primitive values are not supported/,
|
||||
|
||||
@@ -209,6 +209,11 @@ function applyFieldCondition(options: {
|
||||
.andWhereRaw('?? like ? escape ?', ['value', `${escaped}%`, '\\']);
|
||||
return targetQuery.andWhere(onEntityIdField, 'in', matchQuery);
|
||||
}
|
||||
|
||||
if ('$contains' in value) {
|
||||
// TODO(freben): Implement this, AT LEAST for some special cases such as tags and relations.
|
||||
throw new InputError('The $contains operator is not supported');
|
||||
}
|
||||
}
|
||||
|
||||
throw new InputError(
|
||||
|
||||
Reference in New Issue
Block a user