【文件属性】:
文件名称:foreignKey:面向数据设计的实验
文件大小:5KB
文件格式:ZIP
更新时间:2021-06-25 05:03:35
JavaScript
外键
面向数据设计的实验:将键控集合连接到具有定义外键的数组的函数。
例子
给定一个常规的 javascript 对象:
var keyed = {
a : { name : 'The Girl' } ,
b : { name : 'The Guy' }
} ;
还有一个带有外键的集合,比如person :
var collection = [
{ person : 'a' , pet : 'dog' } ,
{ person : 'a' , pet : 'cat' } ,
{ person : 'b' , pet : 'dog' }
] ;
调用外foreignKey会导致:
foreignKey ( 'person' , keyed , collection ) ;
// =>
//
// [
// {person: {name: 'The G
【文件预览】:
foreignKey-master
----.gitignore(31B)
----package.json(757B)
----src()
--------foreignKey.js(1019B)
----dist()
--------foreignKey.js(1KB)
----Vagrantfile(249B)
----LICENSE(1KB)
----index.js(60B)
----README.md(1KB)
----test()
--------rightJoinSpec.js(1KB)
--------keyedSpec.js(992B)