Giter Site home page Giter Site logo

brazil's Introduction

brazil's People

Contributors

beanieboi avatar moonglum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

pseudocorps

brazil's Issues

Select Statement

The Select statement takes a single String with a collection-alias or a JSON Object.

Ideas for the API

@railsbros-dirk and me discussed this today face to face ๐Ÿ˜‰

We will try to mimic the API of Array & Enumerable as close as possible. Basically a collection in ArangoDB is a big array with a lot of hashes in it. Let's give it a try.

Return all documents of the characters collection:

result = Brazil::Collection.new('characters').to_a

A projection via map:

result = Brazil::Collection.new('casting').map do |cast|
  { name: cast.actor, rating: 'awesome' }
end.to_a

Filtering via find_all or select:

result = Brazil::Collection.new('characters')
  .find_all { |character| character.name == 'Sam Lawry' }
  .to_a

Sorting via sort_by:

result = Brazil::Collection.new('characters')
  .sort_by { |character| character.name }
  .to_a

Limit via first, drop and slice:

result = Brazil::Collection.new('characters').first(5).to_a

result = Brazil::Collection.new('characters').slice(5, 10).to_a
# and slice's well known alias:
result = Brazil::Collection.new('characters').slice[5, 10].to_a
# Also: Ranges
result = Brazil::Collection.new('characters').slice[5...10].to_a

Pagination via each_slice:

result = Brazil::Collection.new('characters').each_slice(5) do |some_characters|
  p some_characters
end

Joins via product (to join more collections, just add more to the product call):

result = Brazil::Collection.new('characters').product('casting').find_all do |character, casting| do
  character.name == casting.character
end.map do |character, casting|
  { character: character, casting: casting }
end.to_a

Geo Features

Add support for within and near. As arguments they take...

  • A tuple for the names of the attributes
  • A tuple for the reference point
  • The Radius (within) or the number (near)

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.