本文整理汇总了TypeScript中@arangodb/general-graph._graph函数的典型用法代码示例。如果您正苦于以下问题:TypeScript _graph函数的具体用法?TypeScript _graph怎么用?TypeScript _graph使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_graph函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: String
var action = String(function (args) {
var gm = require("@arangodb/general-graph");
var graph = gm._graph('partyGraph');
var _ = require('underscore');
var party = graph.party.save(_.omit(args[0], 'members'));
graph.member.save(party._id, args[1]._id, { admin: true });
return party;
});
示例2: String
var action = String(function (args) {
var gm = require("@arangodb/general-graph");
var graph = gm._graph('qaGraph');
var _ = require('underscore');
var questionData = _.pick(args[0], 'title', 'options');
questionData.updatedAt = new Date();
return graph.question.update(args[0]._key, questionData);
});
示例3: String
var action = String(function (args) {
var gm = require("@arangodb/general-graph");
var graph = gm._graph('qaGraph');
var _ = require('underscore');
var answerData = _.pick(args[0], 'chosen', 'opinion');
answerData.updatedAt = new Date();
return graph.answer.update(args[0]._key, answerData);
});
示例4: String
var action = String(function (args) {
var gm = require("@arangodb/general-graph");
var graph = gm._graph('userGraph');
var _ = require('underscore');
var userData = _.omit(args[0],
(v, k) => _.isUndefined(v, k) || k === 'location');
var user = graph.user.update(userData._key, userData);
if (args[0].location) {
userData._id = 'user/' + userData._key;
args[0].location._id = 'location/' + args[0].location._key;
graph.livesIn.removeByExample({ _from: userData._id });
graph.livesIn.save(userData._id, args[0].location._id, {});
}
return user;
});