-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetData.js
More file actions
34 lines (30 loc) · 796 Bytes
/
getData.js
File metadata and controls
34 lines (30 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import chzos from "@hybeck/chzOS"
import loadBalancer from "chzos/config"
const osVersion = chzos.versions.V5
const getData = (query:chzDatabase) => {
const initQuery = query.init({
osVersion,
jsEnbaled : true,
database : "mongo_8.0",
location : "ap-south-1",
extended : true, //false to avoid future billings and its will not overlap if you set billing = false in config
provider : "hybeck"
})
chz.sshQuery(query?.query)
.then((data) => {
return data;
})
.catch((error)=>{
chzos.error("db_error:" + error)
return chz.utils.toJSON({
error,
errorMessage : error?.message,
osVersion,
beautify:true
})
})
return query?.LoadMS(loadBalancer?.maxMS || 90000 ) ? query?.exit() : query?.exec()
}
/**
Once it, Once Up
*/