English subtitles

← Exploring Query Restrictions - Developing Scalable Apps with Java

Get Embed Code
4 Languages

Showing Revision 5 created 05/24/2016 by Udacity Robot.

  1. So did you figure out what caused the error? Hopefully
  2. you discovered that it was this one. The first query orders
  3. by name. And then you added the inequality filter from
  4. max attendees. So the first sort order is name, but it
  5. should really be max attendees, because that's where we have
  6. the inequality filter. Composite index not existing might be a problem
  7. that you run into, but it isn't the problem this time.
  8. Unless you deploy straight to app spot, in which case you've
  9. got a couple of different errors going on. And again,
  10. this is a problem you might run into. If you
  11. try to filter, say, on max attendees greater than 100,
  12. and seats available less than ten. Because then you'd be
  13. using inequality filters on two different properties in a single
  14. query. But in this case, this particular error should not
  15. be the problem. We're only using an inequality filter on
  16. a single property. So, here's the arrow in the API's
  17. explorer, and you see it tells us exactly what the
  18. problem is. First sort property must be the same as
  19. property to which the inequality filter is applied. In your
  20. query, the first sort property is main. But the inequality filter
  21. is on max attendees. So when you get these kinds
  22. of errors or any errors, don't be frightened by them, just
  23. go ahead and read them. There's valuable information in the
  24. errors that will pinpoint the problems and help you fix them.