mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-26 03:25:01 +02:00
UBER-1178: rework indexing fields (#4261)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me> Signed-off-by: Andrey Sobolev <haiodo@gmail.com> Co-authored-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
co-authored by
Andrey Sobolev
parent
66368621a0
commit
689e2d4caa
@@ -132,16 +132,7 @@ export function docUpdKey (name: string, opt?: IndexKeyOptions): string {
|
||||
*/
|
||||
export function docKey (name: string, opt?: IndexKeyOptions): string {
|
||||
const extra = opt?.extra !== undefined && opt?.extra?.length > 0 ? `#${opt.extra?.join('#') ?? ''}` : ''
|
||||
let key =
|
||||
(opt?.docId !== undefined ? opt.docId.split('.').join('_') + '|' : '') +
|
||||
(opt?._class === undefined ? name : `${opt?._class}%${name}${extra}`)
|
||||
if (opt?.refAttribute !== undefined) {
|
||||
key = `${opt?.refAttribute}->${key}`
|
||||
}
|
||||
if (opt?.refAttribute !== undefined || (opt?.relative !== undefined && opt?.relative)) {
|
||||
key = '|' + key
|
||||
}
|
||||
return key
|
||||
return opt?._class === undefined ? name : `${opt?._class}%${name}${extra}`
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user