LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview interface with MongoDb or similar NoSql database

Can you put on the mongodb's specific program of your first and the second example?Thank you very much!

0 Kudos
Message 21 of 46
(2,260 Views)
Hi mantou,

I'm not sure if I understand what you mean. Do you mean the equivalent program of we were using the mongodb shell? 🐚

Peter

Regards,

Peter D

0 Kudos
Message 22 of 46
(2,247 Views)

 

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 

0 Kudos
Message 23 of 46
(2,219 Views)

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


Regards,

Peter D

0 Kudos
Message 24 of 46
(2,195 Views)

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! 

0 Kudos
Message 25 of 46
(2,185 Views)

@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 🙂

0 Kudos
Message 26 of 46
(2,077 Views)

Hello,

 

Is there a way to explicitly exclude fields? say for example the _id field?

 

Thanks,

 

-exXo

0 Kudos
Message 27 of 46
(1,988 Views)

 


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.

 

MongoDB Include or Exclude Fields.png

 

I hope this helps.

Message 28 of 46
(1,981 Views)

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. 

 

updatemethod.png

0 Kudos
Message 29 of 46
(1,956 Views)

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.

 

MongoDB Simple Update.png

 

Regards,

Hollowhorse

Message 30 of 46
(1,939 Views)