dresende/node-orm2 — pull request #8 by bramus (2012-12-11 13:41:56+00:00)
Title: Add .only() for hasMany() relations

Limits the returned fields when using `hasMany()` relations

var Movie = db.define('movies', {
id: Number,
title: String,
year: Number,
rating: Number,
description: String
});

var Genre = db.define('genres', {
id: Number,
title: String
});

Movie.hasMany('genres', Genre);

Movie.get(id, function(err, movie) {
movie.getGenres({}, {only: 'id'}, function(err, genres) {
movie.genres = genres;
// ...
});
});