Open reddy6ue opened 6 years ago
@bchong95 please look into this.
The root symbol in the FROM clause has to be a valid identifier (starts w/ an underscore or alpha char and followed by an underscore or alphanumeric char). On the other hand, it really does not have to match the collection name since the collection is inferred from the connection context (you could only establish a connection to a single collection). So basically, you could pick any name here. BTW, '==' is also not valid, replace it by '='.
@sboshra I understand that collection can be inferred from the context itself. However, if we are writing a generic repository layer where queries are distributed across multiple collections, sometimes we have to write plain SQL like queries.
Correct me if I'm wrong, but it's a best practice to make sure that queries across all formats work the same way (including emulator UI or administration UI).
Thanks for point out the ==. Sometimes, I bang my head against the wall for the silliest of reasons.
I haven't tested this out in the cloud db yet, so I don't know if it's just a problem with the emulator.
I have a collection called social-data and I get a DocumentClientException with syntax error at the exact spot where the hyphen is.
Here's the query I'm running.
SELECT * FROM social-data a WHERE a.Type == "Juna.Zone.NewsFeed.Infrastructure.DAO.FeedItemDO" ORDER BY a.DatePublished DESC
The sytax error goes away for the hyphen, but it's occurring further down the line with the query which I am still investigating.