我如何在where子句MongoDB中传递参数值

时间:2018-09-24 15:10:37

标签: javascript mongodb

我的mongoDb查询有问题,我需要搜索任何MongoDB字段的参数值。

我在const webpack = require('C:\\Program Files (x86)\\Microsoft VS Code\\bin\\node_modules\\webpack'); const path = require('C:\\Program Files (x86)\\Microsoft VS Code\\bin\\node_modules\\path'); const nodeFolder = 'C:\\Program Files (x86)\\Microsoft VS Code\\bin\\node_modules\\'; const currentEnv = process.env.NODE_ENV || 'development'; const isProduction = currentEnv === 'production'; //console.log(`Building for Production ${isProduction}`); module.exports = { mode: currentEnv, entry: path.join(__dirname, 'App_Themes\\blah\\scripts\\common2.js'), watch: true, output: { path: path.join(__dirname, 'App_Themes\\blah\\scripts\\'), filename: "common2.min.js" }, resolveLoader: { modules: [nodeFolder] }, resolve: { modules: [nodeFolder] }, module: { rules: [ { test: /\.js$/, loader: 'eslint-loader', enforce: 'pre', // include: [path.resolve(__dirname, '/App_Themes/blah/scripts/')], options: { formatter: require(nodeFolder + 'eslint-friendly-formatter'), failOnError: true }, }, { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: [nodeFolder + '@babel/preset-env'], }, }, }, ], }, plugins: (() => { const common = [ new webpack.ProvidePlugin({ // $: 'jquery', $: nodeFolder + 'jquery', jQuery: 'jquery', 'window.jQuery': 'jquery', ekkoLightbox: 'ekko-lightbox', }), ]; const development = []; const production = []; return isProduction ? common.concat(production) : common.concat(development); })(), devtool: 'source.map', }; 子句中使用一个函数,例如:

$where

返回的响应很好,但是我不知道如何传递值(此示例中为Text36)

有人可以帮我吗?谢谢

0 个答案:

没有答案