Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
*/
const twitterUserSchema = {
name: {
':db/cardinality': ':db.cardinality/one',
':db/unique': ':db.unique/identity'
},
follows: {
':db/cardinality': ':db.cardinality/many',
':db/valueType': ':db.type/ref'
}
};
/**
* Create connection to db (that's been instantiated with the schema above.)
*/
const conn = datascript.create_conn(twitterUserSchema);
/**
* Define some seed data; including some `follower` references (that make
* use of a temporary id to point to other entities within the array.)
*/
const datoms = [
{
':db/id': -1,
name: 'John',
follows: -3
},
{
':db/id': -2,
name: 'David',
follows: [-3, -1]
},