05-06-2016 03:23 AM
Can you put on the mongodb's specific program of your first and the second example?Thank you very much!
05-06-2016 06:50 AM
05-09-2016 02:47 AM
It is the MongoDB Database specific program you used to your giving the example of the Labview.For example,how you create the MongoDB database, collections and documents. Can you understand?
And I also want to know how to use the LabVIEW to insert my collecting data to MongoDB, what kind of functions and controls I can use. It'll be so kind of you If you can give me the complete program.
Thank you so much
05-10-2016 01:46 AM
Hi Mantou,
I'd put together an example that connects to a database, gets a collection and inserts a document into it. It is earlier in this thread here - there is some code attached there as an example.
Hope that helps.
Peter
05-10-2016 04:48 AM
Alright. I just notice that the example you have given before can insert some data to MongoDB by LabVIEW. But I don't understand how data insert to MongoDB? Just like what I have done before, I use serial, TCP, or some other method to connect my LabVIEW and a external equipment. How is your example achieving to insert a collecting real data from our experiment station to MongoDB?
Thank you!
10-06-2016 04:41 AM
@mantou556 wrote:Alright. I just notice that the example you have given before can insert some data to MongoDB by LabVIEW. But I don't understand how data insert to MongoDB? Just like what I have done before, I use serial, TCP, or some other method to connect my LabVIEW and a external equipment. How is your example achieving to insert a collecting real data from our experiment station to MongoDB?
Thank you!
The connection (which is via a TCP/IP socket) is provied by the MongoDB driver (DLL). You just have to provided the server details, in the form of a connection string, and the driver does the rest 🙂
02-15-2017 03:47 PM
Hello,
Is there a way to explicitly exclude fields? say for example the _id field?
Thanks,
-exXo
02-15-2017 04:52 PM - edited 02-15-2017 04:55 PM
Hi exXo,
Yes there is... When you execute a query, the response comes back as cursor reference. You can invoke the SetFields method on this refernce to select which fields are included or excluded from the returned documents.
I hope this helps.
02-20-2017 02:24 PM
Thanks that helped a lot actually.
I'm having problems trying to figure out what to feed the update method. any ideas? it's got a query input as well as an update input.
02-21-2017 05:20 AM - edited 02-21-2017 05:22 AM
The Update and Query inputs are for two special classes of BSON document. The Query document is used to specify which documents, within a collection, will be modified (this is sometimes referred to as the filter argument in the MongoDB documentation). And the Update document defines how the documents targeted during the query operation will be modified.
The simplest form of update document is just a new document, which then replaces the target document in your database. However, the update document can also include a number of special "operators" which allow you to update the fields in the target document without replacing the whole contents.
More on update methods and operators here:
https://docs.mongodb.com/manual/tutorial/update-documents/
https://docs.mongodb.com/manual/reference/operator/update/
The example here finds a document with a given _id value and then replaces the entire document using the contents of the update document.
Regards,
Hollowhorse