nodejs: nedb filename path causing problems; how to fix?

I'm an experienced programmer, but relatively new to nodejs, nedb, Mocha.

nedb is a nodejs npm module for small data usages, that replicates some of the interface used in Mongodb. I chose it because I'm building an app to run on a Beaglebone Black or Raspberry Pi and didn't want the overhead for Mongodb for my small data needs.

However, I'm having a problem with the path portion of the filename for nedb. It works fine if the myapp.js I'm working on is invoked local to the current path, but if I invoke it from a different directory, like my Mocha test directory, then nedb won't work with the same path. It won't work with relative path either; I have to specify the full path, starting with /home before I can get it to work from the Mocha test directory. Needless to say, this is both inconvenient, and prohibitave for production, as it's not running with a base of /home in production.

In the code that follows, myapp.js is the application I'm developing and testing. useMyapp.js is a utility test to use myapp.js for simplicity. These are all in the same directory, and work properly when I invoke useMyapp.js.

I copied useMyapp.js to my Mocha test directory, renamed it to be TestUseMyapp.js, into /home/geek/project/test/
I adjusted the require statment for relative path to myapp.js
Here's the contents of TestUseMyapp.js in /home/geek/project/test/

The output from running this via nodejs is an empty data set:
docs found: []

THE PROBLEM:
TestUseMyapp.js is able to find and load myapp.js per the 'require' statement, but the filename parameter for nedb is not working when myapp.js is invoked from a different directory. This is causing me problems between development, Mocha testing, and running in production, as the file path are all different.

I created a duplicate of myapp.js, named it myapp2.js, and kept it in the same directory as myapp.js at /home/geek/project/public/javascripts. In this, I changed the path for the nedb filename parameter.
Here's the code in myapp2.js PLEASE NOTE THE ONLY CHANGE IS TO THE filename PARAMATER PATH: