yaml-admin-api 0.0.78 → 0.0.79
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/package.json
CHANGED
|
@@ -121,6 +121,20 @@ const generateCrud = async ({ app, db, entity_name, yml_entity, yml, options })
|
|
|
121
121
|
return { $ne: null }
|
|
122
122
|
else if(value == 'null')
|
|
123
123
|
return null
|
|
124
|
+
if(value?.startsWith('$')) {
|
|
125
|
+
const [op, val] = value.split(' ')
|
|
126
|
+
if(op == '$lte')
|
|
127
|
+
return { $lte: parseFloat(val) }
|
|
128
|
+
else if(op == '$gte')
|
|
129
|
+
return { $gte: val }
|
|
130
|
+
else if(op == '$lt')
|
|
131
|
+
return { $lt: val }
|
|
132
|
+
else if(op == '$gt')
|
|
133
|
+
return { $gt: val }
|
|
134
|
+
else
|
|
135
|
+
return value
|
|
136
|
+
}
|
|
137
|
+
|
|
124
138
|
if (type == 'boolean') {
|
|
125
139
|
if(value == 'true')
|
|
126
140
|
return true
|