Skip to content
Browse files

Updated README to describe the new navigate method

  • Loading branch information...
1 parent d9d3348 commit 963088b6e0d8565d5bcf7a149f5851f6bf1b4b27 @visoft committed Aug 25, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0
@@ -194,6 +194,19 @@ OData allows you to [query navigation properties and only return the links for t
product_links = svc.execute # => returns URIs for the products under the Category with an ID of 1
+### Advanced Navigation Property Functions
+There are instances where you may need to navigate down a level in order to form the proper query.
+Take for example [Netflix's OData Service]( and their `Genres` Entity Collection, where you can access a Navigation Property (in this case `Titles` through the `Genre` and filter on it:
+In order to do this within ruby_odata, you can use the `navigate` method of the `QueryBuilder` to drill-down into the Navigation Property. This will allow you to perform `filter`s, `skip`s, `orderby`s, etc. against the children.
+ svc ="")
+ svc.Genres("'Horror Movies'").navigate("Titles").filter("Name eq 'Halloween'")
+ movies = svc.execute
+ movies.each { |m| puts m.Name }
### Count
Sometimes all you want to do is count records, for that, you can use the `count` method.
This method can be combined with other options, such as `filter` but cannot be combined with the `links` method.

0 comments on commit 963088b

Please sign in to comment.
Something went wrong with that request. Please try again.