English 中文(简体)
RavenDB query by index and Time
原标题:RavenDB query by index and DateTime

如果我提出疑问,RavenDB会感到愤怒的话,我很新。 我有一个包含日间财产的课程。 我在RavenDB储存这一类。 我确定了以下指数:

from doc in docs.Orders
from docItemsItem in ((IEnumerable<dynamic>)doc.Items).DefaultIfEmpty()
select new { Items_Price_Amount = docItemsItem.Price.Amount, Items_Quantity = docItemsItem.Quantity, Date = doc.Date }

http://dl.drop Box.com/u/3055964/Capture.GIF <-以下简称

这里的类别定义:

    public class Order
    {
        public DateTime Date { get; set; }
        public IList<OrderItem> Items { get; set; }
        public string CustomerId { get; set; }

        public Order()
        {
            Items = new List<OrderItem>();
        }
    }

现在,当我试图以上述指数来询问拉文亚,那点问题根本不会产生结果。

var orders = session.Query<Order>("OrdersIndex").Where(o => o.Date > DateTime.Now).ToList(); // orders.Count == 0

如果我从询问中删除指数,就如:

var orders = session.Query<Order>().Where(o => o.Date > DateTime.Now).ToList(); // orders.Count == 128

a 设定临时指数,并按预期进行点滴工程。

Does anyone has any idea what s wrong with my query? Thanks.

<>>>>>

所有这一切,我通过管理演播室(在屏幕上播放)拆除了田地日、项目、项目、项目、项目和项目,现在该点工作被罚款。 是否有任何想法? 明确界定这些领域的目的是什么?

问题回答

核实指数中的日期作为指数(x =>x.Date, FieldIndexing)储存。 Default.

我已安排到外地。 分析结果,结果正确。

我需要更多地了解不同外地外联方案之间的差异:





相关问题
Weird Time Issue in Python

Problem with using times in Python. Terminal > Python >>> calendar.timegm(datetime.datetime.now().utctimetuple()) 1258449380 This time indicates GMT: Tue, 17 Nov 2009 09:16:20 GMT Eclipse ...

How does a .NET process get the culture information?

I have a Windows service running (C#, .NET 2.0) on Windows Server 2003 R2. In one server the System.Threading.Thread.CurrentThread.CurrentCulture is {en-AU} and in the other {en-US}. This has caused a ...

Best way to get maximum Date value in java?

I m writing a bit of logic that requires treating null dates as meaning forever in the future (the date in question is an expiration date, which may or may not exist). Instead of putting in special ...

Date format in SQL Server

Short Question: What s the best date format to use in SQL Server? Long Explanation: We re converting our database from mysql to SQL Server. In mysql we always used int(11) to avoid the daylight ...

Converting asp.net/sql web app to be ime zone savy

Our current app stores all dates via the server s datetime. I m thinking we need to update all datetime values in the database over to UTC time. Now for displaying these dates back to the user, I ...

Check if string is of SortableDateTimePattern format

Is there any way I can easily check if a string conforms to the SortableDateTimePattern ("s"), or do I need to write a regular expression? I ve got a form where users can input a copyright date (as a ...

DateTime in PropertyGrid in .Net

I m currently working on some DateTime properties in a PropertyGrid in c#.Net. Im using the default drop-down datetime picker. My question: Is there any way to show the full date with the time? By ...

热门标签