TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kavya Durgam
NA
26
40.1k
Fetching the document from mongodb by passing the parameters
Dec 11 2017 2:51 AM
I need to check the document exixts in the mongodb based on combination of 3 parameters.
this is the query worked on mongo db command prompt:
db.FrequencyQuestionForm.find({"data.formList.Identificatio
nDetails.Study_Id":"1"},{"data.formList.IdentificationDetails.Visit_No":"1"}).li
mit(1)
I want to use this query in entity framework.
[HttpGet]
public object getFrequencyQuestionData()
{
var connectionString = "mongodb://localhost:27017";
MongoClient client = new MongoClient(connectionString);
MongoServer server = client.GetServer();
MongoDatabase db = server.GetDatabase("FormDataBase");
MongoCollection collection = db.GetCollection<Blog>("FrequencyQuestionForm");
// Here i want to call that query ..
MongoCursor<Blog> cursor = collection.FindAllAs<Blog>();
var count = collection.Count();
string document = cursor.ToJson();
JToken token = JToken.Parse(document);
var jObject = JObject.FromObject(new { formdata = token, count });
return jObject;
}
Reply
Answers (
1
)
Online moviee ticket booking in mvc
How to use various charts in asp C#