Hi,
I have a little Meteor application as a pet project for autoformation. It used to work some versions ago. It doesn’t anymore. No errors. No traces. Nor server side, nor client side.
I have this simple code
imports/api/PlayersCollection.js
// External dependencies
import { Mongo } from "meteor/mongo";
export const PlayersCollection = new Mongo.Collection("players");
PlayersCollection.getOfficialRankings = () => {
Log("Getting official rankings")
let result = PlayersCollection.find(
{ rank: { $gt: 0 } },
{ sort: { elo: -1 }, limit: 200 }
).fetch();
Log("officialRankings="+result);
return result;
}
imports/ui/App.svelte
<script>
import MainTitle from './components/MainTitle.svelte';
import Player from './components/Player.svelte';
import {PlayersCollection} from '../api/PlayersCollection';
$m : players = PlayersCollection.getOfficialRankings();
Log("players ="+players);
$m: sectionType = "byElo";
</script>
<div class="container">
<MainTitle/>
<div id="official">
<table class="zigzag">
<thead>
<tr>
<th class="header">#</th>
<th class="header">Joueur</th>
<th class="header">Rang</th>
<th class="header">ELO</th>
</tr>
</thead>
<tbody>
{#each players as player, i}
<Player rank={i+1} player={player} section={sectionType} />
{/each}
</tbody>
</table>
</div>
</div>
players is always empty.
There is a bot running server side using this PlayersCollection and it is working. The MongoDB connection seems ok.
Any clue ? It did work once with the same code !