> var result = session.Query<DataResult>().First(r =>
> r.SiteId == "t108137341");
> Console.WriteLine("result " + result + " state " +
> result.State);//has a result where result.State is null
> var query = session.Query<DataResult>().Where(r =>
> r.State == null).Customize(o =>
> o.WaitForNonStaleResultsAsOfLastWrite()).ToList();
> Console.WriteLine("query count " + query.Count); //no
> results where State = null ???
> There are roughly 400k records and about 20k have State=null but NONE are
> returned when running the query above.
> Cheers,
> Wal
> On Friday, 4 May 2012 21:48:29 UTC+8, Oren Eini wrote:
>> Yes, that would be great
>> On Fri, May 4, 2012 at 2:10 AM, Wallace Turner
>>> Hi Oren, I'm not sure how my new post ended up on this old thread.
>>> Its happening in a database with about ~500k records (not production) -
>>> I have a small bootstrapper app that recreates the issue, i could send you
>>> guys this and the database zipped?
>Note that it doesn't HAVE a State property. Because it doesn't have a state property (vs. having it and it being null), you can't query on that.
Right, I re-generated the index - does the index simply exclude the document as it doesnt have a State property? I'm curious how it would distinguish between a document that has a NULL state and one that doesnt have a state property at all. (keeping in mind that from C# both these documents appear the same)
What is the recommended approach to resolving issues like this, ie data migration where the domain model changes? As a brute force approach it seems I have to fetch all the objects then Save( ) them back to simply populate the null field.
On 6/05/2012 8:25 PM, Oren Eini (Ayende Rahien) wrote:
> var result =
> session.Query<DataResult>().First(r => r.SiteId == "t108137341");
> Console.WriteLine("result " + result + " state
> " + result.State);//has a result where result.State is null
> var query =
> session.Query<DataResult>().Where(r => r.State ==
> null).Customize(o =>
> o.WaitForNonStaleResultsAsOfLastWrite()).ToList();
> Console.WriteLine("query count " +
> query.Count);//no results where State = null ???
> There are roughly 400k records and about 20k have State=null but
> NONE are returned when running the query above.
> Cheers,
> Wal
> On Friday, 4 May 2012 21:48:29 UTC+8, Oren Eini wrote:
> Yes, that would be great
> On Fri, May 4, 2012 at 2:10 AM, Wallace Turner
> Hi Oren, I'm not sure how my new post ended up on this old
> thread.
> Its happening in a database with about ~500k records (not
> production) - I have a small bootstrapper app that
> recreates the issue, i could send you guys this and the
> database zipped?
> >Note that it doesn't HAVE a State property. Because it doesn't have a
> state property (vs. having it and it being null), you can't query on that.
> Right, I re-generated the index - does the index simply exclude the
> document as it doesnt have a State property? I'm curious how it would
> distinguish between a document that has a NULL state and one that doesnt
> have a state property at all. (keeping in mind that from C# both these
> documents appear the same)
> What is the recommended approach to resolving issues like this, ie data
> migration where the domain model changes? As a brute force approach it
> seems I have to fetch all the objects then Save( ) them back to simply
> populate the null field.
> On 6/05/2012 8:25 PM, Oren Eini (Ayende Rahien) wrote:
> Wallace, the issue is the structure of your documents.
> Take a look at this, the document that you are loading:
>> var result = session.Query<DataResult>().First(r
>> => r.SiteId == "t108137341");
>> Console.WriteLine("result " + result + " state " +
>> result.State);//has a result where result.State is null
>> var query = session.Query<DataResult>().Where(r =>
>> r.State == null).Customize(o =>
>> o.WaitForNonStaleResultsAsOfLastWrite()).ToList();
>> Console.WriteLine("query count " + query.Count);//no results where State = null ???
>> There are roughly 400k records and about 20k have State=null but NONE
>> are returned when running the query above.
>> Cheers,
>> Wal
>> On Friday, 4 May 2012 21:48:29 UTC+8, Oren Eini wrote:
>>> Yes, that would be great
>>> On Fri, May 4, 2012 at 2:10 AM, Wallace Turner
>>>> Hi Oren, I'm not sure how my new post ended up on this old thread.
>>>> Its happening in a database with about ~500k records (not production)
>>>> - I have a small bootstrapper app that recreates the issue, i could send
>>>> you guys this and the database zipped?