Question

I have an ASP.NET Web Forms project which is using Readify-Neo4jClient and Neo4J Community 2.0.3, I'm getting a bug where a number stored in the database is changing its value when retrieved. Here is a picture of what’s in the database and what I can see in VS2013:

https://docs.google.com/file/d/0B6b_N7sDgjmvMVF5TFpaZXJmNFk/edit

The code to retrieve the user is as follows:

IEnumerable<SUser> FoundUsers = Neo4jGraphClient.Cypher.Match("(user:User)")
    .Where((SUser user) => user.Email == UserName)
    .Return(user => user.As<SUser>())
    .Results;

Code to write to the database is as follows:

    long DateTimeNow = DateTime.Now.Ticks;
    SUser ss = new SUser
    {
        Id = UserCounter.SubmitAndCommitNewUser(),
        DateOfBirth = DobDay.Text + "" + DobMonth.Text + "" + DobYear.Text,
        Email = UserName.Text,
        FirstName = FirstName.Text,
        LastName = LastName.Text,
        UserCreatedOn = DateTimeNow,
        role = UType.ADMIN,
        Status = UStatus.NEW
    };

    Neo4jReq.CreateSUser(ss);
......
    public static SUser CrseateSUser(SUser NewUser)
    {
        //... 
        Neo4jGraphClient.Cypher
        .Create("(user:User {NewUser})")
        .WithParam("NewUser", NewUser)
        .ExecuteWithoutResults();
        existing = NewUser;
    }

Class is as follows:

public class SUser
{
    public int Id { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string DateOfBirth { get; set; }
    public string Email { get; set; }
    public UType role { get; set; }
    public UStatus Status { get; set; } 
    public string pass { get; set; }
    public string VerificationGUID { get; set; }
    public long UserCreatedOn { get; set; }
    public string UserNotes { get; set; } 
}

Any ideas on whats causing this?

Was it helpful?

Solution

Right - I've got this replicating, this looks like a bug(?) in the way the Neo4j browser shows the data (both the current and older webadmin), so the data stored in Neo4j is correct, but it's getting 'rounded' (in a sense anyway) in the display, if you run the 'Get' query in the browser you get the '00' ending, this also happens in the old web admin:

http://localhost:7474/webadmin/

if you run the query in the 'Data Browser'.

However, if you run the query in the Console (http://localhost:7474/webadmin/#/console/) you'll get the correct results. Neo4jClient is giving you the right results, it's the browser that is wrong in this case.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top