[Fact]
public async Task Test()
{
using var store = GetDocumentStore();
var user1 = new User();
var user2 = new User();
DateTime time;
using (var session = store.OpenAsyncSession())
{
await session.StoreAsync(user1);
await session.SaveChangesAsync();
await Task.Delay(1000);
time = DateTime.UtcNow;
await Task.Delay(1000);
await session.StoreAsync(user2);
await session.SaveChangesAsync();
}
using (var session = store.OpenAsyncSession())
{
var results = await session.Advanced
.AsyncRawQuery<User>("from Users as u where u.'@metadata'.'@last-modified' > $time")
.AddParameter("time", time)
.ToArrayAsync();
var results2 = await session.Advanced.AsyncDocumentQuery<User>()
.WhereGreaterThan("@metadata.@last-modified", time)
.ToArrayAsync();
Assert.True(results.Length == 1 && results[0].Id == user2.Id);
Assert.True(results2.Length == 1 && results2[0].Id == user2.Id);
}
}
![]() | Igal Merhavia Developer / Hibernating Rhinos LTD
|
--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/dfd85063-487a-44fe-8fd4-5457cd73e972n%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/R71sUi4HHNg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CAADcGSmbvUO3jLMjhA-s7mmEb1%2BLf4S7QFhP0JOc%3D6q2aLbeWw%40mail.gmail.com.