@dnax/core 0.3.9 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/driver/mongo/rest.ts +6 -1
- package/package.json +1 -1
package/driver/mongo/rest.ts
CHANGED
|
@@ -40,6 +40,7 @@ type optionCb = {
|
|
|
40
40
|
useHook?: boolean;
|
|
41
41
|
cleanDeep?: boolean;
|
|
42
42
|
useCustomApi?: boolean;
|
|
43
|
+
elementAt: Number | null;
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
const omitUpdate = [
|
|
@@ -503,7 +504,11 @@ class useRest {
|
|
|
503
504
|
});
|
|
504
505
|
}
|
|
505
506
|
|
|
506
|
-
|
|
507
|
+
let resultDocs = toJson(result.docs);
|
|
508
|
+
if (typeof options?.elementAt == "number") {
|
|
509
|
+
resultDocs = resultDocs[options?.elementAt] || null;
|
|
510
|
+
}
|
|
511
|
+
return resolve(resultDocs);
|
|
507
512
|
} catch (err) {
|
|
508
513
|
return reject(err);
|
|
509
514
|
}
|