Giter VIP home page Giter VIP logo

Comments (8)

bchavez avatar bchavez commented on May 22, 2024

hi @fiLLLip , can you show the ReQL you're using? before and after the .update()

from rethinkdb.driver.

fiLLLip avatar fiLLLip commented on May 22, 2024

I'm not at my work computer (where I'm testing this out), but I'm pretty sure it goes like:

// _table = _r.db(_c.Dbname).table(TableName);
_table.get(id).update(updatedObject).run(_connection);

from rethinkdb.driver.

bchavez avatar bchavez commented on May 22, 2024

Hi @fiLLLip , I can't reproduce the behavior you're seeing...

The following passes the unit test on my dev box:

https://github.com/bchavez/RethinkDb.Driver/blob/master/Source/RethinkDb.Driver.Tests/ReQL/GitHubIssues.cs#L12

I need a bit more info on this one.

from rethinkdb.driver.

fiLLLip avatar fiLLLip commented on May 22, 2024

So, I got the logging up and running 👍
Here is the object I'm trying to push to the server:
image
I have now changed the ReQL to:

// _table = _r.db(_c.Dbname).table(TableName);
_table.update(obj).run(_c.Connection);

And the server returns this (I'm fetching the object before updating it):

2015-11-19 11:16:19 [Information] Executing action method "DemoProject.Api.Controllers.FilesController.UploadFile" with arguments (["Microsoft.AspNet.Http.Features.Internal.FormFile", "269571e7-f4c2-4318-b639-bbfd343fa0c7"]) - ModelState is Valid'
2015-11-19 11:16:19 [Verbose] JSON Send: Token: 1, JSON: [1,[16,[[15,[[14,["test"]],"file"]],"269571e7-f4c2-4318-b639-bbfd343fa0c7"]],{}]
2015-11-19 11:16:19 [Verbose] JSON Recv: {"t":1,"r":[{"Description":"Demo asdfasfadsfafile","Name":"testFile","Permissions":[{"Owner":true,"Read":true,"UserId":"5cd708c8-c8b3-4108-8470-547dbd03ef70","Write":true}],"TenantId":"default","Versions":null,"id":"269571e7-f4c2-4318-b639-bbfd343fa0c7"}],"n":[]}
2015-11-19 11:16:19 [Verbose] JSON Send: Token: 1, JSON: [1,[53,[[15,[[14,["test"]],"file"]],{"Name":"testFile","Description":"Demo asdfasfadsfafile","Versions":[2,[{"Version":1,"Bytes":{"$reql_type$":"BINARY","data":{"$reql_type$":"BIN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udExpbmU+DQoJCQk8SXRlbU5yPjgwMzE8L0l0ZW1Ocj4NCgkJCTxJdGVtTmFtZT5CZWdlciAwLDUuIDgwMCBzdGs8L0l0ZW1OYW1lPg0KCQkJPEl0ZW1OYW1lMi8+DQoJCQk8T3JkZXJVbml0PkthcnQuPC9PcmRlclVuaXQ+DQoJCQk8T3JkZXJRdHk+MTwvT3JkZXJRdHk+DQoJCQk8U2hpcFF0eT4xPC9TaGlwUXR5Pg0KCQk8L1NoaXBtZW50TGluZT4NCgkJPFNoaXBtZW50TGluZT4NCgkJCTxJdGVtTnI+MTA0NzwvSXRlbU5yPg0KCQkJPEl0ZW1OYW1lPlRhY28ga2rDuHR0ZGVpZyAgMiBrZzwvSXRlbU5hbWU+DQoJCQk8SXRlbU5hbWUyLz4NCgkJCTxPcmRlclVuaXQ+c3RrPC9PcmRlclVuaXQ+DQoJCQk8T3JkZXJRdHk+NTwvT3JkZXJRdHk+DQoJCQk8U2hpcFF0eT41PC9TaGlwUXR5Pg0KCQk8L1NoaXBtZW50TGluZT4NCgk8L1NoaXBtZW50TGluZXM+DQo8L1NoaXBtZW50Pg=="},"MimeType":"text/xml","Created":[99,["2015-11-19T10:16:19.6303139+00:00"]],"UploadedByUserId":"aa93ca25-8672-4545-a927-90b9b1249f4c"}]],"Permissions":[2,[{"Read":true,"Write":true,"Owner":true,"UserId":"5cd708c8-c8b3-4108-8470-547dbd03ef70"}]],"TenantId":"default","id":"269571e7-f4c2-4318-b639-bbfd343fa0c7"}]],{}]
2015-11-19 11:16:19 [Verbose] JSON Recv: {"t":1,"r":[{"deleted":0,"errors":1,"first_error":"Expected type STRING but found PTYPE<BINARY>.","inserted":0,"replaced":0,"skipped":0,"unchanged":0}],"n":[]}

I see that the previous schema I posted here did not contain the byte[] field, and I'm sorry I didn't post it 😞

The Bytes field is of type byte[]:

public byte[] Bytes { get; set; }

The weird thing is that I didn't get an exception, even though the returned JSON states 1 error.

from rethinkdb.driver.

bchavez avatar bchavez commented on May 22, 2024

Hi @fiLLLip , this should be fixed in 7 alpha 5. As for the driver silently failing: I'm not sure why, but the RethinkDB server is sending us SUCCESS_ATOM Recv: {"t":1, so technically, with respect to the protocol, the response is not an error to be thrown. Ultimately, we had a malformed pesudo binary object.

from rethinkdb.driver.

fiLLLip avatar fiLLLip commented on May 22, 2024

Maybe it's because I was using RethinkDb 2.1.5. I have now updated to 2.2.1.

I will test the new driver version soon 👍

from rethinkdb.driver.

fiLLLip avatar fiLLLip commented on May 22, 2024

The new driver version works like a charm! Great work, as always 👍 😄

from rethinkdb.driver.

bchavez avatar bchavez commented on May 22, 2024

Dont forget to check out the new docs :) I added a whole bunch of cool new stuff including Reactive Extensions support and additional run helpers like runResult().EnsureSuccess()

https://github.com/bchavez/RethinkDb.Driver/wiki/Extra-C%23-Driver-Features

from rethinkdb.driver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.