1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-19 14:14:05 +00:00

Show BSON types correctly

This commit is contained in:
2023-01-24 20:55:53 +01:00
parent b58a2ca84f
commit ae811bc0d5
7 changed files with 183 additions and 13 deletions

View File

@ -9,6 +9,7 @@
import { onMount } from 'svelte';
import Grid from '../../../components/grid.svelte';
import { applicationSettings, views } from '../../../stores';
import { EJSON } from 'bson';
export let collection;
@ -36,8 +37,10 @@
async function submitQuery() {
activePath = [];
result = await FindItems(collection.hostKey, collection.dbKey, collection.key, JSON.stringify(form));
if (result) {
const newResult = await FindItems(collection.hostKey, collection.dbKey, collection.key, JSON.stringify(form));
if (newResult) {
newResult.results = newResult.results?.map(s => EJSON.parse(s, { relaxed: false }));
result = newResult;
submittedForm = JSON.parse(JSON.stringify(form));
}
resetFocus();