Construct String for Query
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Philippe Walliser
il 27 Mag 2019
Commentato: Philippe Walliser
il 27 Mag 2019
I am querying a remote MongoDB Database within Matlab using the Matlab Database Toolbox interface for MongoDB.
Queries tipically look like this:
query5473 = '{"_ref":{$oid:"5ce3e0ec620ea1990ce172177"}, "eventTypeId":5473}';
However, I would like to not manually type the ID but rather use the some element from an array like this:
queryExample = '{"_ref":{$oid:SomeArray(1)}, "eventTypeId":5473}';
Unfortunatelly this results in an error.
Could someone help me out?
0 Commenti
Risposta accettata
Walter Roberson
il 27 Mag 2019
query5473 = sprintf('{"_ref":{$oid:"%s"}, "eventTypeId":5473}', SomeArray{1})
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Database Toolbox in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!