I am building an ASP.Net web application and want to access data from MongoDB (remotely hosted). Any of my documents looks like this (have ensured index on Utc field);
{
"_id" : { "$oid" : "509501393e8785025c10bc21" },
"Index" : 1,
"Url" : "http:...",
"CameraId" : 123,
"Utc" : { "$date" : 1351955858006 }
}
Considering the performance on user end, I want to fetch this data at max speed. One option that i have tried is calling a local Web Service via JSON on Page.aspx which uses MongoDB C# driver to query documents between two Dates (Utc). That works but seems like using web service adds some extra milliseconds in request/response cycle (request for single document using db.foo.findOne() is served in 1.3 seconds on average). Average number of documents in that collection is 50,000 which will increase up-to 30,00,000.
My questions are:
My related question is here.
Regards.
To access the http interface an administrator may, for example, point a browser to http://localhost:28017 if mongod is running with the default port on the local machine.
Atlas Data API is a fully managed REST-like API, to allow you to access your MongoDB Atlas data, and perform CRUD operations and aggregations with ease. Once enabled on a cluster, you can achieve all the CRUD operations out of the box via a URL, with just an API key.
The MongoDB Atlas Data API lets you read and write data in Atlas with standard HTTPS requests. To use the Data API, all you need is an HTTPS client and a valid API key. Clients send requests to specific endpoints, which each represent a MongoDB operation.
You can use read operations to retrieve data from your MongoDB database. There are multiple types of read operations that access the data in different ways. If you want to request results based on a set of criteria from the existing set of data, you can use a find operation such as the find() or findOne() methods.
MongoDB's native HTTP interface is not built for querying. You should continue to do what you are doing. In addition, your MongoDB servers should not be exposed publicly for security purposes and you should always go through a middle tier as you are currently doing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With