Pkira
4/20/2015 - 1:58 PM

MongoDB

MongoDB

var query = Query<WikiSolr>.EQ(obj => obj.Id, artigo.Id);
var update = Update<WikiSolr>.Set(obj => obj.Alias, artigo.Alias);
collection.Update(query, update);
var query = MongoDB.Driver.Builders.Query.EQ("Name", nome_pagina);
var collection = server.GetDatabase(database).GetCollection<WikiSolr>("WikiPage");
var result = collection.FindOne(query);
collection.Insert(Entity);
string connectionString = ConfigurationManager.AppSettings["MongoDBServer"].ToString();
string database = ConfigurationManager.AppSettings["MongoDBCollection"].ToString();
var client_mongo = new MongoClient(connectionString);
var server = client_mongo.GetServer();
var collection = server.GetDatabase(database).GetCollection<SolrObject>("WikiPage");
collection.FindAll().SetSortOrder(SortBy.Descending("Id_Mongo")).SetLimit(1).FirstOrDefault();