mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 22:26:01 +00:00
handle $oid
This commit is contained in:
@@ -8,3 +8,15 @@ export function getPerspectiveMostNestedChildColumnName(columnName: string) {
|
||||
const path = columnName.split('::');
|
||||
return path[path.length - 1];
|
||||
}
|
||||
|
||||
export function perspectiveValueMatcher(value1, value2): boolean {
|
||||
if (value1?.$oid && value2?.$oid) return value1.$oid == value2.$oid;
|
||||
if (Array.isArray(value1)) return !!value1.find(x => perspectiveValueMatcher(x, value2));
|
||||
if (Array.isArray(value2)) return !!value2.find(x => perspectiveValueMatcher(value1, x));
|
||||
return value1 == value2;
|
||||
}
|
||||
|
||||
export function perspectiveValueMatcherSimple(value1, value2): boolean {
|
||||
if (value1?.$oid && value2?.$oid) return value1.$oid == value2.$oid;
|
||||
return value1 == value2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user