Real-Time Exchange Information With Microservices and NodeJs

Loopback Mongo Aggregate

Products.getDataSource().connector.connect(function(err, db) {
     var collection = db.collection('Products');
       [{ $match: { "productCode" : "WIN10-NoOS" } }]



share your WiFi over Ethernet

There is a hidden method to share your WiFi over Ethernet in the latest Gnome.

Type nm-connection-editor in your terminal.
Add a shared network connection by pressing the Add button.
Choose Ethernet from the list and press Create.
Click IPv4 Settings in the left.
Choose Shared to other computers by clicking the Method drop-down menu.
Enter a new name like Shared WiFi LAN as the Connection name at the top

Golang missing module

The steps to do to set up a new Go project with modules:

  1. Have Go installed. Latest version preferably, best >= v1.13 which Go modules the default. For go1.11 and above you will have to do some extra steps to enable Go modules.
  2. Create a new folder for your project. Preferably NOT in GOPATH. By default GOPATH is ~/go, so create your own projects folder, e.g. mkdir ~/projects and then mkdir ~/projects/myproject.
  3. All further commands are run from the new projects root, so best switch there: cd ~/projects/myproject
  4. In the newly created folder run go mod init projectPath where projectPath should be the URL of your future git repo (e.g. This will create the go.mod file in the current folder. It will contain the module name you used in go mod init and the currently installed go version as a minimum version. (Don't worry about that for now, it won't get in your way.) If you don't plan on ever releasing your project, you can name your project anything. But if that ever conflicts with another package or module name, you are in trouble.
  5. Now you can run go get (don't use -u, that is dangerous as it update all sub-dependencies instead of using the dependencies the gin developers used). This should add to your go.mod file as a requirement. If you want to update a dependency, just call go get depPath again. It will update the dependency version in your go.mod file to the latest version available. If you want to up-/downgrade to a specific version use go get depPath@vX.Y.Z.
  6. Create your main.go and use in there.
  7. Use go mod tidy to remove all unused imports or add missing ones to go.mod. (Usually you don't need to edit go.modgo mod tidy will do that for you.) It will also tidy up your go.sum file which holds check sums for all your dependencies. You can have a look at the file, but will (usually) never have to edit it. go mod tidy will do that for you.
  8. In Goland the most important is to make sure Go modules integration is enabled. The other settings should be correct by default.
  9. If you still have problems with the dependencies, you can try a go clean -modcache. It will clear your entire local modules cache, so you need to download all of it again. This can sometimes help if the modules cache got messed up somehow. Should not happen normally, though.

Hope this helps. If it doesn't, let me know so I can add the missing parts.