@@ -1670,40 +1670,48 @@ public Document Resolve(Conflict conflict)
1670
1670
}
1671
1671
}
1672
1672
// end::merge-conflict-resolver[]
1673
-
1673
+ }
1674
1674
1675
1675
// N1QL QUERY
1676
1676
1677
-
1678
- public List < Result > testN1QLQueryString ( Database argDB )
1677
+ public List < Result > docsonly_N1QLQueryString ( Database argDB )
1679
1678
{
1680
- // For Documentation
1681
1679
DatabaseConfiguration dbCfg = new DatabaseConfiguration ( ) ;
1682
- dbCfg . Directory =
1683
- Path . Combine ( Service . GetInstance < IDefaultDirectoryResolver > ( ) . DefaultDirectory ( ) , username ) ;
1684
- // tag::query-syntax-n1ql[]
1680
+
1685
1681
Database thisDb = new Database ( dbName , dbCfg ) ;
1686
1682
1683
+ // For Documentation -- N1QL Query
1684
+ // tag::query-syntax-n1ql[]
1687
1685
var thisQuery =
1688
- thisDb . CreateQuery (
1689
- "SELECT META().id AS thisId FROM $thisDb.name " +
1690
- "WHERE type = $type" ) ; // <.>
1691
-
1692
- thisQuery . Parameters . SetString ( "type" , "hotel" ) ; // <.>
1686
+ thisDb . CreateQuery ( "SELECT META().id AS thisId FROM _ WHERE type = \" hotel\" " ) ; // <.>
1693
1687
1694
- var results = thisQuery . Execute ( ) . AllResults ( ) ;
1688
+ return thisQuery . Execute ( ) . AllResults ( ) ;
1695
1689
1696
- return results ;
1697
1690
// end::query-syntax-n1ql[]
1698
1691
}
1699
1692
1700
- // tag::query-syntax-n1ql-params[]
1701
- tbd
1702
- // end::query-syntax-n1ql-params[]
1703
1693
1704
- // tag::query-access-n1ql[]
1705
- tbd
1706
- // end::query-access-n1ql[]
1694
+ public List < Result > docsonly_N1QLQueryStringParams ( Database argDB )
1695
+ {
1696
+ DatabaseConfiguration dbCfg = new DatabaseConfiguration ( ) ;
1697
+
1698
+ Database thisDb = new Database ( dbName , dbCfg ) ;
1699
+
1700
+ // For Documentation -- N1QL Query
1701
+ // tag::query-syntax-n1ql-params[]
1702
+ // Declared elsewhere: Database argDB
1703
+
1704
+ var thisQuery =
1705
+ thisDb . CreateQuery ( "SELECT META().id AS thisId FROM _ WHERE type = $type" ) ; // <.>
1706
+
1707
+ var n1qlParams = new Parameters ( ) ;
1708
+ n1qlParams . SetString ( "type" , "hotel" ) ; // <.>
1709
+ thisQuery . Parameters = n1qlParams ;
1710
+
1711
+ return thisQuery . Execute ( ) . AllResults ( ) ;
1712
+
1713
+ // end::query-syntax-n1ql-params[]
1714
+ }
1707
1715
1708
1716
1709
1717
// QUERY RESULT SET HANDLING EXAMPLES
0 commit comments