<commit_before>
var Rooms = Meteor.neo4j.collection("Rooms") // any collection name
var roomKey = "Rooms" // any publish-subscribe name

if (Meteor.isServer) {
  var roomQuery = "MATCH (room:Room)-[door:DOOR]->() RETURN room, door"
  Rooms.publish(roomKey, publishRoomQuery)

  function publishRoomQuery(){
    return roomQuery
  }
}

if (Meteor.isClient) {
  Tracker.autorun(function trackDataChanges(){
    var options = null // becomes `this` in the publishRoomQuery() method
    var link = "door" // object name, to link as MongoDB row(s).
    var subscription = Rooms.subscribe(roomKey, options, link)
    console.log("Rooms: ", Rooms)
    console.log("subscription: ", subscription)
  })

  Template.roomList.helpers({
    rooms: function rooms() {
      var cursor = Rooms.find()
      return cursor
    }
  })

  Template.doorList.helpers({
    doors: function doors() {
      var cursor = Rooms.find()
      return cursor
    }
  })

  Template.addRoom.events({<commit_msg>Add Room button adds a room, but bug in Neo4jReactivity Driver creates 2 nodes, one without a Room label<commit_after>
var Rooms = Meteor.neo4j.collection("Rooms") // any collection name
var roomKey = "Rooms" // any publish-subscribe name

if (Meteor.isServer) {
  var roomQuery = "MATCH (room:Room) RETURN room"
  Rooms.publish(roomKey, publishRoomQuery)

  function publishRoomQuery(){
    return roomQuery
  }
}

if (Meteor.isClient) {
  Tracker.autorun(function trackDataChanges(){
    var options = null // becomes `this` in the publishRoomQuery() method
    var link = "room" // object name, to link as MongoDB row(s).
    var subscription = Rooms.subscribe(roomKey, options, link)
    console.log("Rooms: ", Rooms)
    console.log("subscription: ", subscription)
  })

  Template.roomList.helpers({
    rooms: function rooms() {
      var cursor = Rooms.find()
      return cursor
    }
  })

  Template.doorList.helpers({
    doors: function doors() {
      var cursor = Rooms.find()
      return cursor
    }
  })

  Template.addRoom.events({
{'fraction_non_alphanumeric': 0.12149532710280374, 'fraction_numerical': 0.001967535661583866, 'mean_word_length': 3.3836206896551726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '54545', 'n_tokens_mistral': 640, 'n_tokens_neox': 625, 'n_words': 174}