I can verify that your code work with: Truffle v4.0.6 (core: 4.0.6) Solidity v0.4.19 (solc-js) Have you deployed your code? I get the "[]" if I do not first deploy the MyInfo.sol contract. See if this works: Try adding a file "2_deploy.js" to your migration folder with the following code: var MyInfo = artifacts.require("./MyInfo.sol"); module.exports = function(deployer, network, accounts) { deployer.deploy(MyInfo) }; Then from the Truffle development console enter "truffle migrate". This will deploy the MyInfo contract. After this your two commands should work. For more info checkout http://truffleframework.com/docs/getting_started/migrations