mongodb insertone
db.<yourcollection>.insertOne({name :"<yourvalue>", firstname :"<yourvalue>"})
mongodb insertone
db.<yourcollection>.insertOne({name :"<yourvalue>", firstname :"<yourvalue>"})
mongodb insert
db.products.insert( { item: "card", qty: 15 } )
insert command mongo
db.collection.insert( { item: "card", qty: 15 } )
Mongo Insert
using MongoDB.Driver;
using MongoDB.Bson;
namespace InsertDocument
{
class Program
{
static void Main(string[] args)
{
var dbClient = new MongoClient("mongodb://127.0.0.1:27017");
IMongoDatabase db = dbClient.GetDatabase("testdb");
var cars = db.GetCollection<BsonDocument>("cars");
var doc = new BsonDocument
{
{"name", "BMW"},
{"price", 34621}
};
cars.InsertOne(doc);
}
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us