Using the ArangoDB Swagger.io Interactive API Documentation
ArangoDB bundles its regular API Documentation also in Swagger.IO API description format. You can browse and explore it interactively via the ArangoDB Webinterface.
Read more
Using GraphQL with ArangoDB: A NoSQL Database Solution
GraphQL is a query language created by Facebook for modern web and mobile applications as an alternative to REST APIs. Following the original announcement alongside Relay, Facebook has published an official specification and reference implementation in JavaScript. Recently projects outside Facebook like Meteor have also begun to embrace GraphQL.
Read more
Using Bind Parameters in the AQL Editor: ArangoDB
The AQL editor in the web interface is useful for running ad hoc AQL queries and trying things out. It provides a feature to explain the query and inspect its execution plan. This can be used to check if the query uses indexes, and which.
So far the AQL editor only supported using query string literals, but it lacked support for bind parameters. Queries issued by application code however often will use bind parameters for security reasons. Often enough this prevented copying & pasting queries from the application code into the AQL editor and vice versa without making manual adjustments. Read more
Running V8 Isolates in Multi-Threaded ArangoDB
ArangoDB allows running user-defined JavaScript code in the database. This can be used for more complex, stored procedures-like database operations. Additionally, ArangoDB’s Foxx framework can be used to make any database functionality available via an HTTP REST API. It’s easy to build data-centric microservices with it, using the scripting functionality for tasks like access control, data validation, sanitation etc.
We often get asked how the scripting functionality is implemented under the hood. Additionally, several people have asked how ArangoDB’s JavaScript functionality relates to node.js.
This post tries to explain that in detail.
ArangoDB 2.6 API Changes: Updates & Enhancements
ArangoDB 2.6 comes with new and changed APIs as well as changed behavior regarding document keys and several graph functions.
If you use Travis-CI for your tests you can download the Travis-CI ArangoDB build here: Travis-CI/ArangoDB-2.6.0-alpha2.tar.gz
The changes so far:
APIs added
- added batch document removal and lookup APIs:
These APIs can be used to perform multi-document lookup and removal operations efficiently. The arguments to these APIs are the name of the collection plus the array of document keys to fetch or remove.
The endpoints for these APIs are as follows:
PUT /_api/simple/lookup-by-keys PUT /_api/simple/remove-by-keys
Example call to fetch documents:
curl -X PUT \ http://127.0.0.1:8529/\_db/\_system/_api/simple/lookup-by-keys \ --data '{"collection":"myCollection","keys":["test1","test3"]}'
The documents will be returned in an attribute
documents
of the HTTP response.documents
is an array containing all documents found. Only those documents that were actually found will be returned. Documents that were searched but do not exist will not be returned and do not trigger any errors. (more…)
LoopBack Connector for ArangoDB: Seamless Integration
ArangoDB can be used as a backend data source for APIs that you compose with the popular open-source LoopBack Node.js framework.
In a recent blog article on StrongLoop, Nicholas Duffy explains how to use his new loopback-connector-arango connector to access ArangoDB:
Getting Started with the Node.js LoopBack Connector for ArangoDB
The tutorial uses the loopback-connector-arango which is available as npm
and a demo application which is available from Github. (more…)
Bulk Document Lookups: Efficient Data Retrieval with ArangoDB
ArangoDB 2.6 comes with a specialized API for bulk document lookups. The new API allows fetching multiple documents from the server using a single request, making bulk document retrieval more efficient than when using one request per document to fetch.
Provided the documents keys are known, all the client application needs to do is to call the collection’s lookupByKeys
method:
// list of document keys
var keys = [ "foo", "bar", "baz", ...];
var results = db.test.lookupByKeys(keys);
// now all documents are contained in variable 'results'
Additionally, the server-side REST API method for bulk document lookups can be invoked directly via HTTP as follows:
curl \
-X PUT \
http://127.0.0.1:8529/_api/simple/lookup-by-keys \
--data '{"collection":"test","keys":["foo","bar","baz"]}'
Jan compared the functionality with single document requests in his latest blog post.
Full-Text Index Enhancements: ArangoDB Search Optimization
This post is about improvements for the fulltext index in ArangoDB 2.6. The improvements address the problem that non-string attributes were ignored when fulltext-indexing.
Effectively this prevented string values inside arrays or objects from being indexed. Though this behavior was documented, it was limited the usefulness of the fulltext index much. Several users requested the fulltext index to be able to index arrays and object attributes, too.
Finally this has been accomplished, so the fulltext index in 2.6 supports indexing arrays and objects!
Read on in Jan’s blog post about Fulltext Index Enhancements.
Exporting Data for Offline Processing in PHP: ArangoDB Guide
A few weeks ago I wrote about ArangoDB’s specialized export API.
The export API is useful when the goal is to extract all documents from a given collection and to process them outside of ArangoDB.
The export API can provide quick and memory-efficient snapshots of the data in the underlying collection, making it suitable for extract all documents of the collection. It will be able to provide data much faster than with an AQL query that will extract all documents.
In this post I’ll show how to use the export API to extract data and process it with PHP.
Please read the full blog post Exporting Data for Offline Processing.
Creating Multi-Game Highscore Lists: ArangoDB Techniques
I just came across a question about how to create highscore lists or leaderboards in ArangoDB, and how they would work when compared to Redis sorted sets.
This blog post tries to give an answer on the topic and also detailed instructions and queries for setting up highscore lists with ArangoDB. The additional section “Extensions” explains slightly more advanced highscore list use cases like multi-game highscore lists, joining data and maintaining a “last updated” date.
(more…)
Get the latest tutorials,
blog posts and news:
Thanks for subscribing! Please check your email for further instructions.