Answers for "how to make query dynamic in mongodb"

C#
0

dynamic mongo db

const mongoose = require('mongoose');

const testSchema = new mongoose.Schema({
    label: {
        required: 'please enter label',
        trim: true,
        type: String
    },
    url: {
        type: String,
        trim: true,
    },
    settings: {
      type:Schema.Types.Mixed ,
      default: {}
    } 
    }, {
        timestamps: true, strict: false
    });


module.exports = mongoose.model('test', testSchema);
Posted by: Guest on October-02-2021
0

Query mongodb collection as dynamic

# You can use the string-based syntax, since the expression doesn't offer any advantages with dynamic anyway:

var cursor = db.GetCollection<dynamic>("foo")
               .Find(Builders<dynamic>.Filter.Eq("_id", someId));
Posted by: Guest on October-19-2021

Code answers related to "how to make query dynamic in mongodb"

C# Answers by Framework

Browse Popular Code Answers by Language