首页 \ 问答 \ 在这两种情况下,哪个Neo4j端点正在使用?(Which Neo4j endpoint is in use in these two cases?)

在这两种情况下,哪个Neo4j端点正在使用?(Which Neo4j endpoint is in use in these two cases?)

我在服务器模式下使用Neo4J,并通过REST API发送密码查询。 我也在测量查询的性能,这就是为什么我使用两个不同的库:

(标准?)neo4j-rest-graphdb.jar其中我正在与类RestAPIFacade建立连接: RestAPI graphDb = new RestAPIFacade(...);

Neo4J-jDBC-2.1.4.jar我在哪里使用DriverManager.getConnection(..)来获得连接。

据我的理解,这里的一切都使用REST,而Neo4j还没有tcp / socket连接。 对于REST API,您可以使用不同的端点 (例如事务性HTTP端点,...),这可以解释不同的执行时间。 在FOAF查询中,jDBC版本速度提高了一半以上。 为什么这样以及用户代码背后会发生什么?


I'm using Neo4J in server mode, and the cypher queries are being sent over via REST API. I'm also measuring the performance of queries, that is why I use two different libraries:

(Standard?) neo4j-rest-graphdb.jar where I'm establishing a connection with class RestAPIFacade:RestAPI graphDb = new RestAPIFacade(...);

and

Neo4J-jDBC-2.1.4.jar Where I use DriverManager.getConnection(..) to get a connection.

As far as my understanding goes, everything here uses REST, there is no tcp/socket connection for Neo4j yet. For REST API you can use different endpoints (e.g. transactional HTTP endpoint, ...), which would explain different execution times. jDBC version is more than a half faster on a FOAF query. Why is that so and what is going on behind the user code?


原文:https://stackoverflow.com/questions/33842433
更新时间:2023-07-20 07:07

最满意答案

其实我搞清楚了!

我做的修改是在Angular Service:

data: invoiceService

没有$ .param ..

在Laravel控制器中,我所做的只是:

return file_get_contents('php://input')

这很有效!


Actually I figured it out!

The modification I made was in Angular Service:

data: invoiceService

That's without the $.param..

And in the Laravel controller all I did was:

return file_get_contents('php://input')

And that worked!

相关问答

更多
  • 你的AJAX是发布的,但你没有设置POST路由,只有GET。 添加一条POST路线,如下所示: Route::post('home', "MyController@home"); Your AJAX is POSTing, but you have no POST route set, only GET. Add a POST route, like so: Route::post('home', "MyController@home");
  • 问题是您创建了一个新实例来保存数据而不是现有数据。 这就是为什么在数据库中创建新行的原因。 你的代码应该是这样的。 public function update($id){ $fixedAssetData = FAModel::find($id); $fixedAssetData->AssetCode = Input::json('detailAssetCode'); $fixedAssetData->Description = Input::json('detailDescrip ...
  • 当你使用POST方法时,你应该传递一个键/值对而不是一个字符串,一个对象,更改: data: $('.app_date').val(), 至: data: { _date: $('.app_date').val() }, As you are using POST method you should pass a key/value pair instead of a string, an object, change: data: $('.app_date').val(), to: data: { ...
  • 当你说“将数据存储到JSON中”时,你的意思是直接把它放到data.json文件中吗? 如果是的话,Javascript是一种前端语言,并且无法访问承载它的文件系统。 解决方案是运行Go,Node.JS或PHP等后端语言来接受post请求并将该数据写入data.json。 When you say "store the data into JSON" do you mean put it into the data.json file directly? If yes, Javascript is a fr ...
  • 所以这可以归结为几个问题: 1)Chrome不喜欢通过该文件访问的页面。 它需要在Web服务器中运行。 幸运的是,当angularjs文件放置在public/文件夹内时,Laravel可以很好地处理angularjs。 2)由于路由被放置到api.php ,实际的路径是api/submit 。 So this came down to a few issues: 1) Chrome does not like pages to be accessed via the file. It needs to ru ...
  • 您可以使用$request->input('your_json_key')在Laravel中检索输入。 示例基本保存数据: $post = new Post(); $post->title = $request->input('title'); $post->save(); 以上代码将创建新帖子并将其保存到posts表(取决于您的模型设置)。 有关更多信息,请访问: https : //laravel.com/docs/5.3/requests#accessing-the-request You can ...
  • 尝试这个: 第1步:在Controller的构造函数中创建BASE_URL public function __construct() { if (!defined('BASE_URL')) define('BASE_URL', url('/') . '/'); } 第2步:定义路线 Route::post('category', 'CategoryController@postCategory'); 第3步:将“BASE_URL”添加到HTML并在Script中实现。