DocumentDB SQL Query works in Query Explorer but not in C# code -


i want value of variable(inputassetid) stored in document string.wrote query.it works fine in queryexplorer.

 this.client = new documentclient(new uri(endpointuri), primarykey);  iqueryable<asset> id = this.client.createdocumentquery<asset>(                urifactory.createdocumentcollectionuri(databasename,collectionname),                "select c.inputassetid c c.blobnamedb='bigbuckbunny.mp4' ");  console.writeline( id.string()); 

instead of value stored in variable,what got in console given below

{"query":"select c.inputassetid c c.blobnamedb='bigbuckbunny.mp4' "} 

can please give me solution?

the issue aren't ever executing query you've created. correct code along lines:

this.client = new documentclient(new uri(endpointuri), primarykey); var query = this.client.createdocumentquery<asset>(          ... linq or sql query...     .asdocumentquery();  var result = await query.executenextasync<string>(); console.writeline(result.tolist().firstordefault()); 

you may want use top 1 in query (and not feedoptions.maxitemcount = 1, latter badly named - means how many items per feed request returned @ most. using low maxitemcount can lead great number of useless queries).


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -