[CSHARP-1641] Filter does not work Created: 29/Apr/16  Updated: 05/Apr/19  Resolved: 22/Dec/16

Status: Closed
Project: C# Driver
Component/s: Operations
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Helen Peng Assignee: Unassigned
Resolution: Done Votes: 0
Labels: question
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File PageEventReport.ascx.cs     PNG File screenshot-1.png     PNG File screenshot-2.png    

 Description   

I tried to utilize C# provider for Mongo(http://mongodb.github.io/mongo-csharp-driver/2.2/getting_started/installation/) to filter the records stored in Analytics database of Sitecore 8.0 instance.

Here is the code snippet. For some reason, the filter does not work because the number of documents (>2k) are same before and after applying the filter. However, I expect only one record (see the second screenshot).

Your suggestion would be much appreciated!



 Comments   
Comment by Craig Wilson [ 18/May/16 ]

Hi Helen,

Thank you for providing the code.

I think we have some spelling issues that are preventing this from working.

For instance, in the entity definition:

 public class PageEvents
        {
            public Guid ItemId { get; set; }
            public string Data { get; set; }
            public string DataKey { get; set; }
 
            public Guid PageEventDefintionId { get; set; }
            public DateTime DateTime { get; set; }
        }

PageEventDefintionId is spelled wrong. That is ok if it is consistently spelled the same way. However, later when building the filter, it is spelled differently:

var filter = Builders<BsonDocument>.Filter.Eq("Pages.PageEvents.PageEventDefinitoinId", "5de3f816-809d-47fd-a985-fb3814cb9fbb");

"PageEventDefintionId" != "PageEventDefinitoinId"

I think that fixing this will solve your problem.

Craig

Comment by Helen Peng [ 17/May/16 ]

Hi Craig,
Please refer to the attached file PageEventReport.ascx.cs.
Regards,
Helen

Comment by Craig Wilson [ 16/May/16 ]

Hi Helen,

I am not able to reproduce this at all. Could you provide a sample program that demonstrates the issue?

Craig

Comment by Helen Peng [ 29/Apr/16 ]

Sorry, can not correct the title "Filter does not work" after creating it

Generated at Wed Feb 07 21:40:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.